Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes

Comments

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


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Aug 03 '12, 5:05 a.m.

Question was seen: 4,526 times

Last updated: Aug 03 '12, 8:21 a.m.

Confirmation Cancel Confirm