/** * Gets called by BundleFile during {@link BundleFile#getFile(String, boolean)}. This method * will allocate a File object where content of the specified path may be * stored for this generation. The returned File object may * not exist if the content has not previously been stored. * @param path the path to the content to extract from the generation * @return a file object where content of the specified path may be stored. */ public File getExtractFile(String path) { StringBuilder builder = new StringBuilder(); builder.append(getBundleId()).append('/').append(getGenerationId()); if (path.length() > 0 && path.charAt(0) != '/') { builder.append('/'); } builder.append(path); return getStorage().getFile(builder.toString(), true); }
/** * Gets called by BundleFile during {@link BundleFile#getFile(String, boolean)}. This method * will allocate a File object where content of the specified path may be * stored for this generation. The returned File object may * not exist if the content has not previously been stored. * @param path the path to the content to extract from the generation * @return a file object where content of the specified path may be stored. */ public File getExtractFile(String path) { StringBuilder builder = new StringBuilder(); builder.append(getBundleId()).append('/').append(getGenerationId()); if (path.length() > 0 && path.charAt(0) != '/') { builder.append('/'); } builder.append(path); return getStorage().getFile(builder.toString(), true); }
/** * Gets called by BundleFile during {@link BundleFile#getFile(String, boolean)}. This method * will allocate a File object where content of the specified path may be * stored for this generation. The returned File object may * not exist if the content has not previously been stored. * @param path the path to the content to extract from the generation * @return a file object where content of the specified path may be stored. */ public File getExtractFile(String path) { StringBuilder builder = new StringBuilder(); builder.append(getBundleId()).append('/').append(getGenerationId()); if (path.length() > 0 && path.charAt(0) != '/') { builder.append('/'); } builder.append(path); return getStorage().getFile(builder.toString(), true); }
File contentFile = getContentFile(staged, isReference, bundleInfo.getBundleId(), newGen.getGenerationId()); newGen.setContent(contentFile, isReference);
out.writeUTF(bundleInfo.getLocation()); out.writeLong(bundleInfo.getNextGenerationId()); out.writeLong(generation.getGenerationId()); out.writeBoolean(generation.isDirectory()); out.writeBoolean(generation.isReference()); } else { out.writeUTF(Storage.getBundleFilePath(bundleInfo.getBundleId(), generation.getGenerationId()));
/** * Gets called by BundleFile during {@link BundleFile#getFile(String, boolean)}. This method * will allocate a File object where content of the specified path may be * stored for this generation. The returned File object may * not exist if the content has not previously been stored. * @param path the path to the content to extract from the generation * @param base the base path that is prepended to the path, may be null * @return a file object where content of the specified path may be stored. * @throws StorageException if the path will escape the persistent storage of * the generation starting at the specified base */ public File getExtractFile(String base, String path) { StringBuilder baseBuilder = new StringBuilder(); baseBuilder.append(getBundleId()).append('/').append(getGenerationId()); if (base != null) { baseBuilder.append('/').append(base); } return getStorage().getFile(baseBuilder.toString(), path, true); }
/** * Gets called by BundleFile during {@link BundleFile#getFile(String, boolean)}. This method * will allocate a File object where content of the specified path may be * stored for this generation. The returned File object may * not exist if the content has not previously been stored. * @param path the path to the content to extract from the generation * @return a file object where content of the specified path may be stored. */ public File getExtractFile(String path) { StringBuilder builder = new StringBuilder(); builder.append(getBundleId()).append('/').append(getGenerationId()); if (path.length() > 0 && path.charAt(0) != '/') { builder.append('/'); } builder.append(path); return getStorage().getFile(builder.toString(), true); }
/** * Gets called by BundleFile during {@link BundleFile#getFile(String, boolean)}. This method * will allocate a File object where content of the specified path may be * stored for this generation. The returned File object may * not exist if the content has not previously been stored. * @param path the path to the content to extract from the generation * @return a file object where content of the specified path may be stored. */ public File getExtractFile(String path) { StringBuilder builder = new StringBuilder(); builder.append(getBundleId()).append('/').append(getGenerationId()); if (path.length() > 0 && path.charAt(0) != '/') { builder.append('/'); } builder.append(path); return getStorage().getFile(builder.toString(), true); }
void delete(Generation generation) { try { getStorage().delete(getStorage().getFile(getBundleId() + "/" + generation.getGenerationId(), false)); //$NON-NLS-1$ } catch (IOException e) { storage.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.WARNING, "Error deleting generation.", e); //$NON-NLS-1$ } }
void unlockGeneration(Generation generation) { synchronized (this.infoMonitor) { if (generationLocks == null) { throw new IllegalStateException("The generation id was not locked."); //$NON-NLS-1$ } generationLocks.unlock(generation.getGenerationId()); } }
void unlockGeneration(Generation generation) { synchronized (this.infoMonitor) { if (generationLocks == null) { throw new IllegalStateException("The generation id was not locked."); //$NON-NLS-1$ } generationLocks.unlock(generation.getGenerationId()); } }
void delete(Generation generation) { try { getStorage().delete(getStorage().getFile(getBundleId() + "/" + generation.getGenerationId(), false)); //$NON-NLS-1$ } catch (IOException e) { storage.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.WARNING, "Error deleting generation.", e); //$NON-NLS-1$ } }
void delete(Generation generation) { try { getStorage().delete(getStorage().getFile(getBundleId() + "/" + generation.getGenerationId(), false)); //$NON-NLS-1$ } catch (IOException e) { storage.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.WARNING, "Error deleting generation.", e); //$NON-NLS-1$ } }
void unlockGeneration(Generation generation) { synchronized (this.infoMonitor) { if (generationLocks == null) { throw new IllegalStateException("The generation id was not locked."); //$NON-NLS-1$ } generationLocks.unlock(generation.getGenerationId()); } }
void unlockGeneration(Generation generation) { synchronized (this.infoMonitor) { if (generationLocks == null) { throw new IllegalStateException("The generation id was not locked."); //$NON-NLS-1$ } generationLocks.unlock(generation.getGenerationId()); } }
void unlockGeneration(Generation generation) { synchronized (this.infoMonitor) { if (generationLocks == null) { throw new IllegalStateException("The generation id was not locked."); //$NON-NLS-1$ } generationLocks.unlock(generation.getGenerationId()); } }
void delete(Generation generation) { try { getStorage().delete(getStorage().getFile(getBundleId() + "/" + generation.getGenerationId(), false)); //$NON-NLS-1$ } catch (IOException e) { storage.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.WARNING, "Error deleting generation.", e); //$NON-NLS-1$ } }
void unlockGeneration(Generation generation) { synchronized (this.infoMonitor) { if (generationLocks == null) { throw new IllegalStateException("The generation id was not locked."); //$NON-NLS-1$ } generationLocks.unlock(generation.getGenerationId()); } }
void delete(Generation generation) { try { getStorage().delete(getStorage().getFile(getBundleId() + "/" + generation.getGenerationId(), false)); //$NON-NLS-1$ } catch (IOException e) { storage.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.WARNING, "Error deleting generation.", e); //$NON-NLS-1$ } }
void delete(Generation generation) { try { getStorage().delete(getStorage().getFile(getBundleId() + "/" + generation.getGenerationId(), false)); //$NON-NLS-1$ } catch (IOException e) { storage.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.WARNING, "Error deleting generation.", e); //$NON-NLS-1$ } }