1

Given an IFileStore and knowledge that it represents a file in the local file system, how can it be converted to the IPath?

Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487

2 Answers2

3

I would go with this:

File file = iFileStore().toLocalFile(0, null);
IPath path = Path.fromOSString(file.getCanonicalPath());

The other answer would probably work, but the answer here is likely safer.

Andrew Eisenberg
  • 28,387
  • 9
  • 92
  • 148
0

Try this:

String path = iFileStore.getParent().getName();
...
IPath iPath = Path.fromPortableString(path);

You probably have to do some string manipulation on the path string where I have the ellipses.

Since you have the test bed, you can more easily determine what code goes in the ellipses. Feel free to update this answer with what you find.

Gilbert Le Blanc
  • 50,182
  • 6
  • 67
  • 111