private Manifest createSuppliedManifest(JarPackageData jarPackage) throws CoreException, IOException { Manifest manifest; // No need to use buffer here because Manifest(...) does InputStream stream= jarPackage.getManifestFile().getContents(false); try { manifest= new Manifest(stream); } finally { if (stream != null) stream.close(); } return manifest; }
private Manifest createSuppliedManifest(JarPackageData jarPackage) throws CoreException, IOException { Manifest manifest; // No need to use buffer here because Manifest(...) does InputStream stream= jarPackage.getManifestFile().getContents(false); try { manifest= new Manifest(stream); } finally { if (stream != null) stream.close(); } return manifest; }
private Manifest createSuppliedManifest(JarPackageData jarPackage) throws CoreException, IOException { Manifest manifest; // No need to use buffer here because Manifest(...) does InputStream stream= jarPackage.getManifestFile().getContents(false); try { manifest= new Manifest(stream); } finally { if (stream != null) stream.close(); } return manifest; } }
private Manifest createSuppliedManifest(JarPackageData jarPackage) throws CoreException, IOException { Manifest manifest; // No need to use buffer here because Manifest(...) does InputStream stream= jarPackage.getManifestFile().getContents(false); try { manifest= new Manifest(stream); } finally { if (stream != null) stream.close(); } return manifest; } }
private Manifest createSuppliedManifest(JarPackageData jarPackage) throws CoreException, IOException { Manifest manifest; // No need to use buffer here because Manifest(...) does InputStream stream= jarPackage.getManifestFile().getContents(false); try { manifest= new Manifest(stream); } finally { if (stream != null) stream.close(); } return manifest; } }
/** * Tells whether a manifest is available. * * @return <code>true</code> if the manifest is generated or the provided one is accessible */ public boolean isManifestAccessible() { if (isManifestGenerated()) return true; IFile file= getManifestFile(); return file != null && file.isAccessible(); }
/** * Tells whether a manifest is available. * * @return <code>true</code> if the manifest is generated or the provided one is accessible */ public boolean isManifestAccessible() { if (isManifestGenerated()) return true; IFile file= getManifestFile(); return file != null && file.isAccessible(); }
/** * Tells whether a manifest is available. * * @return <code>true</code> if the manifest is generated or the provided one is accessible */ public boolean isManifestAccessible() { if (isManifestGenerated()) return true; IFile file= getManifestFile(); return file != null && file.isAccessible(); }
private void saveManifest() throws CoreException, IOException { ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream(); Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage); manifest.write(manifestOutput); ByteArrayInputStream fileInput= new ByteArrayInputStream(manifestOutput.toByteArray()); IFile manifestFile= fJarPackage.getManifestFile(); if (manifestFile.isAccessible()) { if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, manifestFile.getFullPath().toString())) manifestFile.setContents(fileInput, true, true, null); } else manifestFile.create(fileInput, true, null); }
private void saveManifest() throws CoreException, IOException { ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream(); Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage); manifest.write(manifestOutput); ByteArrayInputStream fileInput= new ByteArrayInputStream(manifestOutput.toByteArray()); IFile manifestFile= fJarPackage.getManifestFile(); if (manifestFile.isAccessible()) { if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, manifestFile.getFullPath(), false)) manifestFile.setContents(fileInput, true, true, null); } else manifestFile.create(fileInput, true, null); }
private void saveManifest() throws CoreException, IOException { ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream(); Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage); manifest.write(manifestOutput); ByteArrayInputStream fileInput= new ByteArrayInputStream(manifestOutput.toByteArray()); IFile manifestFile= fJarPackage.getManifestFile(); if (manifestFile.isAccessible()) { if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, manifestFile.getFullPath(), false)) manifestFile.setContents(fileInput, true, true, null); } else manifestFile.create(fileInput, true, null); }
protected void saveManifest() throws CoreException, IOException { ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream(); ByteArrayInputStream fileInput= null; try { Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage); manifest.write(manifestOutput); fileInput= new ByteArrayInputStream(manifestOutput.toByteArray()); IFile manifestFile= fJarPackage.getManifestFile(); if (manifestFile.isAccessible()) { // AspectJ Change Begin if (fJarPackage.allowOverwrite() || AJJarPackagerUtil.askForOverwritePermission(fParentShell, manifestFile.getFullPath().toString())) // AspectJ Change End manifestFile.setContents(fileInput, true, true, null); } else manifestFile.create(fileInput, true, null); } finally { if (manifestOutput != null) manifestOutput.close(); if (fileInput != null) fileInput.close(); } }
protected void handleManifestFileBrowseButtonPressed() { ElementTreeSelectionDialog dialog= createWorkspaceFileSelectionDialog(JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_title, JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_message); if (fJarPackage.isManifestAccessible()) dialog.setInitialSelections(fJarPackage.getManifestFile()); if (dialog.open() == Window.OK) { Object[] resources= dialog.getResult(); if (resources.length != 1) setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_onlyOneManifestMustBeSelected); else { setErrorMessage(""); //$NON-NLS-1$ fJarPackage.setManifestLocation(((IResource)resources[0]).getFullPath()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); } } }
protected void handleManifestFileBrowseButtonPressed() { ElementTreeSelectionDialog dialog= createWorkspaceFileSelectionDialog(JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_title, JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_message); if (fJarPackage.isManifestAccessible()) dialog.setInitialSelections(new IResource[] {fJarPackage.getManifestFile()}); if (dialog.open() == Window.OK) { Object[] resources= dialog.getResult(); if (resources.length != 1) setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_onlyOneManifestMustBeSelected); else { setErrorMessage(""); //$NON-NLS-1$ fJarPackage.setManifestLocation(((IResource)resources[0]).getFullPath()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); } } }
protected void handleManifestFileBrowseButtonPressed() { ElementTreeSelectionDialog dialog= createWorkspaceFileSelectionDialog(JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_title, JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_message); if (fJarPackage.isManifestAccessible()) dialog.setInitialSelections(new IResource[] {fJarPackage.getManifestFile()}); if (dialog.open() == Window.OK) { Object[] resources= dialog.getResult(); if (resources.length != 1) setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_onlyOneManifestMustBeSelected); else { setErrorMessage(""); //$NON-NLS-1$ fJarPackage.setManifestLocation(((IResource)resources[0]).getFullPath()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); } } }
protected void handleManifestFileBrowseButtonPressed() { ElementTreeSelectionDialog dialog= createWorkspaceFileSelectionDialog(JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_title, JarPackagerMessages.JarManifestWizardPage_manifestSelectionDialog_message); if (fJarPackage.isManifestAccessible()) dialog.setInitialSelections(new IResource[] {fJarPackage.getManifestFile()}); if (dialog.open() == Window.OK) { Object[] resources= dialog.getResult(); if (resources.length != 1) setErrorMessage(JarPackagerMessages.JarManifestWizardPage_error_onlyOneManifestMustBeSelected); else { setErrorMessage(""); //$NON-NLS-1$ fJarPackage.setManifestLocation(((IResource)resources[0]).getFullPath()); fManifestFileText.setText(fJarPackage.getManifestLocation().toString()); } } }