public UnpackJarBuilder(JarPackageData jarPackage) { fSubfolder= jarPackage.getAbsoluteJarLocation().removeFileExtension().lastSegment() + SUBFOLDER_SUFFIX; fSubfolderPath= jarPackage.getAbsoluteJarLocation().removeLastSegments(1).append(fSubfolder); fJarPackage= jarPackage; }
File file= fJarPackage.getAbsoluteJarLocation().toFile(); if (file.exists()) { if (!file.canWrite()) if (fJarPackage.allowOverwrite()) return true; return parent != null && JarPackagerUtil.askForOverwritePermission(parent, fJarPackage.getAbsoluteJarLocation(), true);
File file= fJarPackage.getAbsoluteJarLocation().toFile(); if (file.exists()) { if (!file.canWrite()) if (fJarPackage.allowOverwrite()) return true; return parent != null && JarPackagerUtil.askForOverwritePermission(parent, fJarPackage.getAbsoluteJarLocation(), true);
public UnpackJarBuilder(JarPackageData jarPackage) { fSubfolder= jarPackage.getAbsoluteJarLocation().removeFileExtension().lastSegment() + SUBFOLDER_SUFFIX; fSubfolderPath= jarPackage.getAbsoluteJarLocation().removeLastSegments(1).append(fSubfolder); fJarPackage= jarPackage; }
File file= fJarPackage.getAbsoluteJarLocation().toFile(); if (file.exists()) { if (!file.canWrite()) if (fJarPackage.allowOverwrite()) return true; return parent != null && JarPackagerUtil.askForOverwritePermission(parent, fJarPackage.getAbsoluteJarLocation().toOSString());
public void exportAntScript(MultiStatus status) { if (!fAntScriptSaveCheckbox.getSelection()) return; if (canCreateAntScript(getShell())) { LaunchConfigurationElement element= fLauchConfigurationModel.get(fLaunchConfigurationCombo.getSelectionIndex()); Assert.isNotNull(element); FatJarAntExporter antExporter= getLibraryHandler().getAntExporter(fAntScriptLocation, fJarPackage.getAbsoluteJarLocation(), element.getLaunchConfiguration()); try { antExporter.run(status); } catch (CoreException e) { status.add(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, FatJarPackagerMessages.FatJarPackageWizardPage_error_ant_script_generation_failed, e)); } } }
public void exportAntScript(MultiStatus status) { if (!fAntScriptSaveCheckbox.getSelection()) return; if (canCreateAntScript(getShell())) { LaunchConfigurationElement element= fLauchConfigurationModel.get(fLaunchConfigurationCombo.getSelectionIndex()); Assert.isNotNull(element); FatJarAntExporter antExporter= getLibraryHandler().getAntExporter(fAntScriptLocation, fJarPackage.getAbsoluteJarLocation(), element.getLaunchConfiguration()); try { antExporter.run(status); } catch (CoreException e) { status.add(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, FatJarPackagerMessages.FatJarPackageWizardPage_error_ant_script_generation_failed, e)); } } }
public void exportAntScript(MultiStatus status) { if (!fAntScriptSaveCheckbox.getSelection()) return; if (canCreateAntScript(getShell())) { LaunchConfigurationElement element= fLauchConfigurationModel.get(fLaunchConfigurationCombo.getSelectionIndex()); Assert.isNotNull(element); FatJarAntExporter antExporter= getLibraryHandler().getAntExporter(fAntScriptLocation, fJarPackage.getAbsoluteJarLocation(), element.getLaunchConfiguration()); try { antExporter.run(status); } catch (CoreException e) { status.add(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, FatJarPackagerMessages.FatJarPackageWizardPage_error_ant_script_generation_failed, e)); } } }
/** * Tells whether this JAR package data can be used to generate * a valid JAR. * * @return <code>true</code> if the JAR Package info is valid */ public boolean isValid() { return (areGeneratedFilesExported() || areJavaFilesExported()) && getElements() != null && getElements().length > 0 && getAbsoluteJarLocation() != null && isManifestAccessible() && isMainClassValid(new BusyIndicatorRunnableContext()); }
/** * Tells whether this JAR package data can be used to generate * a valid JAR. * * @return <code>true</code> if the JAR Package info is valid */ public boolean isValid() { return (areGeneratedFilesExported() || areJavaFilesExported()) && getElements() != null && getElements().length > 0 && getAbsoluteJarLocation() != null && isManifestAccessible() && isMainClassValid(new BusyIndicatorRunnableContext()); }
private void registerInWorkspaceIfNeeded() { IPath jarPath= fJarPackage.getAbsoluteJarLocation(); 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 JavaPlugin.log(ex); } } } } }
private void registerInWorkspaceIfNeeded() { IPath jarPath= fJarPackage.getAbsoluteJarLocation(); 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 JavaPlugin.log(ex); } } } }
private void registerInWorkspaceIfNeeded() { IPath jarPath= fJarPackage.getAbsoluteJarLocation(); 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 JavaPlugin.log(ex); } } } } }
/** * Tells whether this JAR package data can be used to generate * a valid JAR. * * @return <code>true</code> if the JAR Package info is valid */ public boolean isValid() { return (areGeneratedFilesExported() || areJavaFilesExported()) && getElements() != null && getElements().length > 0 && getAbsoluteJarLocation() != null && isManifestAccessible() && isMainClassValid(new BusyIndicatorRunnableContext()); }
private void registerInWorkspaceIfNeeded() { IPath jarPath= fJarPackage.getAbsoluteJarLocation(); 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 JavaPlugin.log(ex); } } } }
private void registerInWorkspaceIfNeeded() { IPath jarPath= fJarPackage.getAbsoluteJarLocation(); 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 JavaPlugin.log(ex); } } } } }
private void registerInWorkspaceIfNeeded() { IPath jarPath= fJarPackage.getAbsoluteJarLocation(); 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 JavaPlugin.log(ex); } } } } }
private void registerInWorkspaceIfNeeded() { IPath jarPath= fJarPackage.getAbsoluteJarLocation(); 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 JavaPlugin.log(ex); } } } } }
private void registerInWorkspaceIfNeeded() { IPath jarPath= fJarPackage.getAbsoluteJarLocation(); 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 JavaPlugin.log(ex); } } } }
private void registerInWorkspaceIfNeeded() { IPath jarPath= fJarPackage.getAbsoluteJarLocation(); 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 JavaPlugin.log(ex); } } } } }