/** * Writes the passed resource to the current archive. * * @param resource * the file to be written * @param destinationPath * the path for the file inside the archive * @throws CoreException * to signal any other unusual termination. This can also be * used to return information in the status object. */ public void write(IFile resource, IPath destinationPath) throws CoreException { try { if (fJarPackage.areDirectoryEntriesIncluded()) addDirectories(resource, destinationPath); addFile(resource, destinationPath); } catch (IOException ex) { // Ensure full path is visible String message= null; if (ex.getLocalizedMessage() != null) message= Messages.format(JarPackagerMessages.JarWriter_writeProblemWithMessage, new Object[] {resource.getFullPath(), ex.getLocalizedMessage()}); else message= Messages.format(JarPackagerMessages.JarWriter_writeProblem, resource.getFullPath()); throw JarPackagerUtil.createCoreException(message, ex); } }
/** * Writes the passed resource to the current archive. * * @param resource * the file to be written * @param destinationPath * the path for the file inside the archive * @throws CoreException * to signal any other unusual termination. This can also be * used to return information in the status object. */ public void write(IFile resource, IPath destinationPath) throws CoreException { try { if (fJarPackage.areDirectoryEntriesIncluded()) addDirectories(resource, destinationPath); addFile(resource, destinationPath); } catch (IOException ex) { // Ensure full path is visible String message= null; if (ex.getLocalizedMessage() != null) message= Messages.format(JarPackagerMessages.JarWriter_writeProblemWithMessage, new Object[] {BasicElementLabels.getPathLabel(resource.getFullPath(), false), ex.getLocalizedMessage()}); else message= Messages.format(JarPackagerMessages.JarWriter_writeProblem, BasicElementLabels.getPathLabel(resource.getFullPath(), false)); throw JarPackagerUtil.createCoreException(message, ex); } }
/** * Writes the passed resource to the current archive. * * @param resource * the file to be written * @param destinationPath * the path for the file inside the archive * @throws CoreException * to signal any other unusual termination. This can also be * used to return information in the status object. */ public void write(IFile resource, IPath destinationPath) throws CoreException { try { if (fJarPackage.areDirectoryEntriesIncluded()) addDirectories(resource, destinationPath); addFile(resource, destinationPath); } catch (IOException ex) { // Ensure full path is visible String message= null; if (ex.getLocalizedMessage() != null) message= Messages.format(JarPackagerMessages.JarWriter_writeProblemWithMessage, new Object[] {BasicElementLabels.getPathLabel(resource.getFullPath(), false), ex.getLocalizedMessage()}); else message= Messages.format(JarPackagerMessages.JarWriter_writeProblem, BasicElementLabels.getPathLabel(resource.getFullPath(), false)); throw JarPackagerUtil.createCoreException(message, ex); } }