// bulk method to fetch all transport VRLs at once; public VRL[] getTransportVRLsForChildren() throws VrsException { // list full details: VFSNode[] nodesArray = list(); ArrayList<String> filePathsList = new ArrayList<String>(); // get file paths for (int i = 0; i < nodesArray.length; i++) { if (nodesArray[i] instanceof SRMFile) { filePathsList.add(nodesArray[i].getPath()); } // else skip directories! } // get transfer urls String[] filePathsArray = new String[filePathsList.size()]; filePathsArray = filePathsList.toArray(filePathsArray); ITaskMonitor monitor = getVRSContext() .getTaskWatcher() .getCurrentThreadTaskMonitor("getTransportVRLsForChildern", -1); VRL[] tVrls = srmfs.getTransportVRLs(monitor, filePathsArray); return tVrls; }
@Override public boolean exists() throws VrsException { if (srmfs.pathExists(getPath()) == false) return false; // path exists, now check for directory type ! return this.srmfs.isDirectory(this.fetchFullDetails().getType()); }
private TMetaDataPathDetail fetchFullDetails() throws VrsException { // check if full details have been fetched. If not fetch them. if (srmDetails == null) { srmDetails = srmfs.queryPath(getPath()); } return srmDetails; }
public VRL rename(String newName, boolean renameFullPath) throws VrsException { String newPath = null; if ((renameFullPath == true) || (newName.startsWith("/"))) newPath = newName; else newPath = getVRL().getDirname() + "/" + newName; return srmfs.mv(getPath(), newPath); }
public boolean delete(boolean recurse) throws VrsException { ITaskMonitor monitor = getVRSContext() .getTaskWatcher() .getCurrentThreadTaskMonitor("Deleting (SRM) directory:" + this.getPath(), 1); monitor.logPrintf("Deleting SRM Directory:" + this + "\n"); return srmfs.rmdir(getPath(), recurse); }
public SRMDir(SRMFileSystem client, TMetaDataPathDetail details, DirQuery dirQ) { super(client, (VRL) null); this.srmfs = client; this.srmDetails = details; this.dirQuery = dirQ; // recreate Dir VRL ! VRL vrl = client.createPathVRL(details.getPath(), null); this.setLocation(vrl); }
public SRMDir(SRMFileSystem client, VRL vrl) { super(client, (VRL) null); this.srmfs = client; // parse dir query or return null object! this.dirQuery = DirQuery.parseDirQuery(vrl); // update VRL ! VRL parsedVrl = client.createPathVRL(vrl.getPath(), dirQuery); this.setLocation(parsedVrl); }
public boolean create(boolean force) throws VrsException { VDir dir = srmfs.createDir(getPath(), force); return (dir != null); }
private void debugPrintf(String format, Object... args) { SRMFileSystem.getLogger().debugPrintf("SRMDir:" + format, args); // System.err.printf(format,args); }