public ArchiveOptions cloneWith(LoadStrategy aLoadStrategy, String uri) { ArchiveOptions result = cloneWith(aLoadStrategy); result.setIsReadOnly(isReadOnly(uri)); return result; }
public void setLoadStrategy(org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.LoadStrategy newLoadStrategy) { loadStrategy = newLoadStrategy; loadStrategy.setReadOnly(isReadOnly()); loadStrategy.setRendererType(getRendererType()); }
/** * @see com.ibm.etools.archive.SaveStrategy */ public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest aManifest) throws SaveFailureException { try { OutputStream out = getUriConverter().createOutputStream(URI.createURI(J2EEConstants.MANIFEST_URI)); aManifest.write(out); out.close(); if (getArchive().getOptions().isReadOnly()) setTimestampAfterSaving(J2EEConstants.MANIFEST_URI); } catch (IOException iox) { throw new SaveFailureException(J2EEConstants.MANIFEST_URI, iox); } }
/** * Create a load strategy for a nested archive; by default will extract the nested archive to a * temp file for performance reasons. This is because random access to the zip entries in a * nested archive is not supported by the java.util.zip package, and if the archive's contents * are being modified, copied, etc, this is much faster. If a temp file can not be created, or * if the archive is opened read only (for runtime), then use a NestedArchiveLoadStrategy, which * retrieves the contents of a zip entry by sequentially searching a zip input stream */ public LoadStrategy createNestedLoadStrategy(String uri, LoadStrategy parent) { LoadStrategy loadStrategy = null; ArchiveOptions options = ((Archive) parent.getContainer()).getOptions(); if (!options.isReadOnly(uri)) loadStrategy = createTempZipFileStrategyIfPossible(uri, parent); if (loadStrategy == null) return new NestedArchiveLoadStrategyImpl(parent); return loadStrategy; }
protected void updateModificationTracking(Resource res) { boolean trackingMods = res.isTrackingModification(); boolean isReadOnly = (container != null) ? ((Archive) container).getOptions().isReadOnly() : false; boolean shouldTrackMods = !(isReadOnly || ArchiveUtil.isJavaResource(res) || ArchiveUtil.isRegisteredURIMapping(res)); if (shouldTrackMods && !trackingMods) res.setTrackingModification(true); }
/** * Used internally; clients should not need to call */ public FileIterator getFileIterator() throws IOException { if (((Archive) getContainer()).getOptions().isReadOnly()) return new NestedArchiveIterator(getContainer().getFiles(), getZipInputStream()); return super.getFileIterator(); }
boolean oldDelivery = eDeliver(); try { if (getOptions().isReadOnly()) eSetDeliver(false); aStrategy.setFilter(getSaveFilter()); if (getOptions().isReadOnly() && !getLoadStrategy().isDirectory()) { files.clear();
return !anArchive.getOptions().isReadOnly(); else if (anArchive.getOptions().isSaveLibrariesAsFiles() && anArchive.getLoadingContainer() != null) { if (anArchive.isIndexed()) {