agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/util/DataLocator.java
/**
	 * Parses response from listing into a response identical to that returned by the Files API.
	 *
	 * @param listing
	 * @param path
	 * @param systemId
	 * @return
	 */
Parses response from listing into a response identical to that returned by the Files API.
Parses response from listing into a response identical to that returned by the Files API .
private List<FileBean> parseRemoteListing(List<RemoteFileInfo> listing, String path, String systemId)
	{
		List<FileBean> beans = new ArrayList<FileBean>();
		for (RemoteFileInfo entry : listing)
		{
			FileBean bean = new FileBean();
			bean.setName(entry.getName());
			bean.setPath((path + "/" + entry.getName()).replaceAll("/+", "/"));
			bean.setOwner(entry.getOwner());
			try
			{
				bean.setLastModified(entry.getLastModified());
			}
			catch (Exception e)
			{
				bean.setLastModified(null);
			}
			bean.setLength(entry.getSize());
			bean.setDirectory(entry.isDirectory());
			bean.setReadable(true);
			bean.setWritable(entry.userCanWrite());
			bean.setSystemId(systemId);
			bean.setJobId(job.getUuid());
			bean.setUrl(Settings.IPLANT_JOB_SERVICE + job.getUuid() + "/outputs/media" + UrlPathEscaper.escape(bean.getPath()));
			bean.setParent(path);
			beans.add(bean);
		}
		return beans;
	}
private List < FileBean > parseRemoteListing ( List < RemoteFileInfo > listing , String path , String systemId ) { List < FileBean > beans = new ArrayList < FileBean > ( ) ; for ( RemoteFileInfo entry : listing ) { FileBean bean = new FileBean ( ) ; bean . setName ( entry . getName ( ) ) ; bean . setPath ( ( path + "/" + entry . getName ( ) ) . replaceAll ( "/+" , "/" ) ) ; bean . setOwner ( entry . getOwner ( ) ) ; try { bean . setLastModified ( entry . getLastModified ( ) ) ; } catch ( Exception e ) { bean . setLastModified ( null ) ; } bean . setLength ( entry . getSize ( ) ) ; bean . setDirectory ( entry . isDirectory ( ) ) ; bean . setReadable ( true ) ; bean . setWritable ( entry . userCanWrite ( ) ) ; bean . setSystemId ( systemId ) ; bean . setJobId ( job . getUuid ( ) ) ; bean . setUrl ( Settings . IPLANT_JOB_SERVICE + job . getUuid ( ) + "/outputs/media" + UrlPathEscaper . escape ( bean . getPath ( ) ) ) ; bean . setParent ( path ) ; beans . add ( bean ) ; } return beans ; }
Parses response from listing into a response identical to that returned by the Files API.
Parses response from listing into a response identical to that returned by the Files API .
// adjust path to strip end slash, but not prefix //		path = StringUtils.length(path) > 1 ? StringUtils.removeEnd(path, "/") : path;