protected void saveDescription() throws CoreException, IOException { // Adjust JAR package attributes if (fJarPackage.isManifestReused()) fJarPackage.setGenerateManifest(false); ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream(); IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput); ByteArrayInputStream fileInput= null; try { writer.write(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); IFile descriptionFile= fJarPackage.getDescriptionFile(); if (descriptionFile.isAccessible()) { // AspectJ Change Begin if (fJarPackage.allowOverwrite() || AJJarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath().toString())) // AspectJ Change End descriptionFile.setContents(fileInput, true, true, null); } else descriptionFile.create(fileInput, true, null); } finally { if (fileInput != null) fileInput.close(); if (writer != null) writer.close(); } }
private void saveDescription() throws CoreException, IOException { // Adjust JAR package attributes if (fJarPackage.isManifestReused()) fJarPackage.setGenerateManifest(false); ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream(); IFile descriptionFile= fJarPackage.getDescriptionFile(); String encoding= "UTF-8"; //$NON-NLS-1$ try { encoding= descriptionFile.getCharset(true); } catch (CoreException exception) { JavaPlugin.log(exception); } IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput, encoding); ByteArrayInputStream fileInput= null; try { writer.write(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); if (descriptionFile.isAccessible()) { if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath().toString())) descriptionFile.setContents(fileInput, true, true, null); } else descriptionFile.create(fileInput, true, null); } finally { if (fileInput != null) fileInput.close(); if (writer != null) writer.close(); } }
private void saveDescription() throws CoreException, IOException { // Adjust JAR package attributes if (fJarPackage.isManifestReused()) fJarPackage.setGenerateManifest(false); ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream(); IFile descriptionFile= fJarPackage.getDescriptionFile(); String encoding= "UTF-8"; //$NON-NLS-1$ try { encoding= descriptionFile.getCharset(true); } catch (CoreException exception) { JavaPlugin.log(exception); } IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput, encoding); ByteArrayInputStream fileInput= null; try { writer.write(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); if (descriptionFile.isAccessible()) { if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath(), false)) descriptionFile.setContents(fileInput, true, true, null); } else descriptionFile.create(fileInput, true, null); } finally { if (fileInput != null) fileInput.close(); if (writer != null) writer.close(); } }
private void saveDescription() throws CoreException, IOException { // Adjust JAR package attributes if (fJarPackage.isManifestReused()) fJarPackage.setGenerateManifest(false); ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream(); IFile descriptionFile= fJarPackage.getDescriptionFile(); String encoding= "UTF-8"; //$NON-NLS-1$ try { encoding= descriptionFile.getCharset(true); } catch (CoreException exception) { JavaPlugin.log(exception); } IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput, encoding); ByteArrayInputStream fileInput= null; try { writer.write(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); if (descriptionFile.isAccessible()) { if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath(), false)) descriptionFile.setContents(fileInput, true, true, null); } else descriptionFile.create(fileInput, true, null); } finally { if (fileInput != null) fileInput.close(); if (writer != null) writer.close(); } }