Example #1
0
 /** {@inheritDoc} */
 public void writeFile(IFile resource, IPath destinationPath) throws CoreException {
   try {
     fileExporter.write(resource, destinationPath.toString());
   } catch (IOException ex) {
     throw PharUIUtil.createCoreException(ex.getLocalizedMessage(), ex);
   }
 }
Example #2
0
 private void registerInWorkspaceIfNeeded() {
   IPath jarPath = fJarPackage.getAbsolutePharLocation();
   IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
   for (int i = 0; i < projects.length; i++) {
     IProject project = projects[i];
     // The Jar is always put into the local file system. So it can only be
     // part of a project if the project is local as well. So using getLocation
     // is currently save here.
     IPath projectLocation = project.getLocation();
     if (projectLocation != null && projectLocation.isPrefixOf(jarPath)) {
       try {
         jarPath = jarPath.removeFirstSegments(projectLocation.segmentCount());
         jarPath = jarPath.removeLastSegments(1);
         IResource containingFolder = project.findMember(jarPath);
         if (containingFolder != null && containingFolder.isAccessible())
           containingFolder.refreshLocal(IResource.DEPTH_ONE, null);
       } catch (CoreException ex) {
         // don't refresh the folder but log the problem
         PHPUiPlugin.log(ex);
       }
     }
   }
 }