|
Re: problem in --> IFile org.eclipse.core.resources.IProject.getFile(String name) [message #333753 is a reply to message #333752] |
Fri, 02 January 2009 11:42 |
Ed Merks Messages: 33254 Registered: July 2009 |
Senior Member |
|
|
Anand,
The only method for mapping a file system path to an IFile is
IWorkspaceRoot.findFilesForLocation. Don't assume that anything File in
the file system will necessarily correspond to an IFile in the workspace
though...
Anand Kumar Gupta wrote:
> I am doing following operation:
> (Absolute path of my file : C:\100_test\Untitled_confdata.xml)
>
> String projectName = "Local";
> IWorkspace ws = ResourcesPlugin.getWorkspace();
> IProject project = ws.getRoot().getProject(projectName.toLowerCase());
> File tempFile = new File(filePath);
> //filePath is getting passed by another method
>
> IFile file = project.getFile(tempFile.getCanonicalPath());
>
> //this file is coming like-(1)-> L/local/100_test/Untitled_confdata.xml
> //but it should come like
> this-(2)->L/local/C�F/100_test/Untitled_confdata.xml
>
>
> Please tell me how would i get the file like the 2nd.....
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04147 seconds