Friday, August 22, 2014

Converting Java io File to eclipse IFile resource

Below function will convert File to eclipse IFile resource.

public IFile convert(File file) {
   IWorkspace workspace= ResourcesPlugin.getWorkspace();  
   IPath location= Path.fromOSString(file.getAbsolutePath());
   IFile ifile= workspace.getRoot().getFileForLocation(location);
 return ifile;


This works only when resource exists with in the workspace.

Accessing the resources outside the workspace:

1 comment:

  1. Once someone converts to become a customer, several factors can affect the after-sales relationship. Your customer service, communications, and order fulfillment will determine customer satisfaction levels. Ultimately, if you get it right, you can encourage more customers to come back, delivering higher Customer Lifetime Value (CLV) for your business.