/** * Adds an entry to the layer with the given permissions. Only adds the single source file to * the exact path in the container file system. See {@link Builder#addEntry(Path, * AbsoluteUnixPath)} for more information. * * @param sourceFile the source file to add to the layer * @param pathInContainer the path in the container file system corresponding to the {@code * sourceFile} * @param permissions the file permissions on the container. If null, then default permissions * are used (644 for files, 755 for directories) * @return this * @see Builder#addEntry(Path, AbsoluteUnixPath) */ public Builder addEntry( Path sourceFile, AbsoluteUnixPath pathInContainer, @Nullable FilePermissions permissions) { layerEntries.add(new LayerEntry(sourceFile, pathInContainer, permissions)); return this; }
@VisibleForTesting LayerEntryTemplate(LayerEntry layerEntry) throws IOException { sourceFile = layerEntry.getSourceFile().toAbsolutePath().toString(); extractionPath = layerEntry.getExtractionPath().toString(); lastModifiedTime = Files.getLastModifiedTime(layerEntry.getSourceFile()).toInstant(); permissions = layerEntry.getPermissions().toOctalString(); }
eventDispatcher.dispatch(LogEvent.info("\t\t" + layerEntry.getSourceFile()));
eventDispatcher.dispatch(LogEvent.info("\t\t" + layerEntry.getSourceFile()));
layerEntry.getSourceFile().toFile(), layerEntry.getExtractionPath().toString()); entry.setMode((entry.getMode() & ~0777) | layerEntry.getPermissions().getPermissionBits());
/** * Adds an entry to the layer with the given permissions. Only adds the single source file to * the exact path in the container file system. See {@link Builder#addEntry(Path, * AbsoluteUnixPath)} for more information. * * @param sourceFile the source file to add to the layer * @param pathInContainer the path in the container file system corresponding to the {@code * sourceFile} * @param permissions the file permissions on the container. If null, then default permissions * are used (644 for files, 755 for directories) * @return this * @see Builder#addEntry(Path, AbsoluteUnixPath) */ public Builder addEntry( Path sourceFile, AbsoluteUnixPath pathInContainer, @Nullable FilePermissions permissions) { layerEntries.add(new LayerEntry(sourceFile, pathInContainer, permissions)); return this; }
@VisibleForTesting LayerEntryTemplate(LayerEntry layerEntry) throws IOException { sourceFile = layerEntry.getSourceFile().toAbsolutePath().toString(); extractionPath = layerEntry.getExtractionPath().toString(); lastModifiedTime = Files.getLastModifiedTime(layerEntry.getSourceFile()).toInstant(); permissions = layerEntry.getPermissions().toOctalString(); }
/** * Adds an entry to the layer with the given permissions. Only adds the single source file to * the exact path in the container file system. See {@link Builder#addEntry(Path, * AbsoluteUnixPath)} for more information. * * @param sourceFile the source file to add to the layer * @param pathInContainer the path in the container file system corresponding to the {@code * sourceFile} * @param permissions the file permissions on the container. If null, then default permissions * are used (644 for files, 755 for directories) * @return this * @see Builder#addEntry(Path, AbsoluteUnixPath) */ public Builder addEntry( Path sourceFile, AbsoluteUnixPath pathInContainer, @Nullable FilePermissions permissions) { layerEntries.add(new LayerEntry(sourceFile, pathInContainer, permissions)); return this; }
@VisibleForTesting LayerEntryTemplate(LayerEntry layerEntry) throws IOException { sourceFile = layerEntry.getSourceFile().toAbsolutePath().toString(); extractionPath = layerEntry.getExtractionPath().toString(); lastModifiedTime = Files.getLastModifiedTime(layerEntry.getSourceFile()).toInstant(); permissions = layerEntry.getPermissions().toOctalString(); }
layerEntry.getSourceFile().toFile(), layerEntry.getExtractionPath().toString()); entry.setMode((entry.getMode() & ~0777) | layerEntry.getPermissions().getPermissionBits());
layerEntry.getSourceFile().toFile(), layerEntry.getExtractionPath().toString()); entry.setMode((entry.getMode() & ~0777) | layerEntry.getPermissions().getPermissionBits());