//String pp = this.getName().getPath(); //get the parent path.
//final GridFtpFileObject parent2 = (GridFtpFileObject) this.fileSystem.resolveFile(pp);
FileInfo newFileInfo;
if (parent != null) {
// Updates this.fileInfo + parent.children by listing parent FO,
// and extracts relevant FileInfo object in order to update
// this.fileInfo ! In doing this, parent.children is also updated and cached.
// (note, because getChildFile() is performed on a Parent
// instance, no other info for 'this' class will be updated/cached,
// e.g. this.children does not get updated). This is v.important !
newFileInfo = parent.getChildFile(UriParser.decode(getName().getBaseName()), flush);
} else {
// Assume the root is a directory and exists
newFileInfo = new FileInfo();
newFileInfo.setName("/");
newFileInfo.setFileType(FileInfo.DIRECTORY_TYPE);
}
this.fileInfo = newFileInfo;
}