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

Remote FileitemHandle vs. local path only

Dears,

Does anybody know

(1) how to get the remote IFileItem for one local code file when only its local path is provided?

(2) how to get local path when only the remote IFileItemHandle is provided?

Thanks.

0 votes



3 answers

Permanent link
(1) how to get the remote IFileItem for one local code file when only
its local path is provided?


((IShareable)ResourcesPlugin.getWorkspace().getRoot().getFile
(path).getAdapter(IShareable.class)).getRemote();

(2) how to get local path when only the remote IFileItemHandle is
provided?

You need to know the remote workspace and component as well.

FileSystemCore.getSharingManager().findShareable
(FileSystemCore.getSharingManager().getDefaultCFARoot(), item, component,
workspace, monitor).getLocalFullPath();

- Dmitry

0 votes


Permanent link
((IShareable)ResourcesPlugin.getWorkspace().getRoot().getFile
(path).getAdapter(IShareable.class)).getRemote();


it returns null with my input on path "/project-name/src/package-name/class-name.java"

why is that result?

0 votes


Permanent link
((IShareable)ResourcesPlugin.getWorkspace().getRoot().getFile
(path).getAdapter(IShareable.class)).getRemote();

it returns null with my input on path
"/project-name/src/package-name/class-name.java"

why is that result?

Either "project-name" is not shared, or "class-name.java" is a newly
added file that is not present on the server, or the file
"/project-name/src/package-name/class-name.java" does not exist at all.

- Dmitry

0 votes

Your answer

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
× 10,937

Question asked: Aug 21 '08, 11:27 a.m.

Question was seen: 6,301 times

Last updated: Aug 21 '08, 11:27 a.m.

Confirmation Cancel Confirm