It's all about the answers!

Ask a question

Remote FileitemHandle vs. local path only


Peng Ji (112) | asked Aug 21 '08, 11:27 a.m.
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.

3 answers



permanent link
Dmitry Karasik (1.8k11) | answered Aug 21 '08, 11:27 a.m.
JAZZ DEVELOPER
(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

permanent link
Peng Ji (112) | answered Aug 21 '08, 10:13 p.m.
((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?

permanent link
Dmitry Karasik (1.8k11) | answered Aug 22 '08, 4:25 a.m.
JAZZ DEVELOPER
((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

Your answer


Register or 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.