コード例 #1
0
 @Override
 public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
   if (IFile.class.equals(adapter)) {
     final IWorkspace workspace = ResourcesPlugin.getWorkspace();
     final IWorkspaceRoot workspaceRoot = workspace.getRoot();
     final IFile file = workspaceRoot.getFile(new Path(reachable.getPath()));
     return file;
   }
   return null;
 }
コード例 #2
0
 @Override
 public String getRevisionIdentification() {
   String path = reachable.getPath();
   if ("file".equals(reachable.getScheme())) {
     File f = new File(path);
     if (f.exists()) {
       return String.valueOf(f.lastModified());
     }
   } else if ("platform".equals(reachable.getScheme())) {
     IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(path));
     if (f.exists()) {
       return String.valueOf(f.getModificationStamp());
     }
   }
   return null;
 }