Link directly a file A from a Component B to an IFileItem type instance
Hey,
I have the name of a file and it's full path. How can I get hold of the IFileItem type object for that certain file without going through all of my repository? At this point I have a recursive method that goes through the repository until it finds that certain file.
IConfiguration configuration= workspace.configuration(component);
From configuration.childEntriesForRoot(null); I can obtain for each file a IVersionableHandle and after that I do the cast fileHandle = (IFileItemHandle) test;
This method it's really time consuming. I need a method that receives the full path of the file and if that file is in the repository, then it returns the IFileItem for that file, else a error message.
I've tried :
ISharingManager manager = FileSystemCore.getSharingManager();
ILocation location = new PathLocation(fileContaingFolderPath);
IShareable shareable = manager.findShareable(location, ResourceType.FOLDER); but in shareable i get a null instance. Also I did not find the javadoc for the IShareable class.
Comments
ioana lazar
Aug 03 '12, 8:21 a.m.Hey, I solved my problem starting from this answer https://jazz.net/forum/questions/35000/how-do-you-retreve-file-content-using-java-api Thanks