Class RegularFile
java.lang.Object
org.fedoraproject.xmvn.tools.install.File
org.fedoraproject.xmvn.tools.install.RegularFile
A regular file created installed in target package.
The file can be installed either by coping an existing file (source file), or by writing provided contents.
- Author:
- Mikolaj Izdebski
-
Constructor Summary
ConstructorsConstructorDescriptionRegularFile
(Path targetPath, byte[] content) Create a regular file object, which contents will be populated from a byte array.RegularFile
(Path targetPath, byte[] content, int accessMode) Create a regular file object, which contents will be populated from a byte array.RegularFile
(Path targetPath, Path sourcePath) Create a regular file object, which contents will be populated from a source file.RegularFile
(Path targetPath, Path sourcePath, int accessMode) Create a regular file object, which contents will be populated from a source file.RegularFile
(Path targetPath, Supplier<byte[]> content) Create a regular file object, which contents will be populated from a byte array.RegularFile
(Path targetPath, Supplier<byte[]> content, int accessMode) Create a regular file object, which contents will be populated from an input stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
installContents
(Path targetPath) Install the file into specified location.Methods inherited from class org.fedoraproject.xmvn.tools.install.File
equals, getAccessMode, getDescriptor, getDescriptorExtra, getTargetPath, hashCode, install
-
Constructor Details
-
RegularFile
Create a regular file object, which contents will be populated from a source file. Target file will have default access mode (0644).- Parameters:
targetPath
- file path, relative to installation rootsourcePath
- path to source file which will be copied to target path
-
RegularFile
Create a regular file object, which contents will be populated from a byte array. Target file will have default access mode (0644).- Parameters:
targetPath
- file path, relative to installation rootcontent
- array of bytes used to populate target file contents with
-
RegularFile
Create a regular file object, which contents will be populated from a byte array. Target file will have default access mode (0644).- Parameters:
targetPath
- file path, relative to installation rootcontent
- provider of array of bytes used to populate target file contents with
-
RegularFile
Create a regular file object, which contents will be populated from a source file. Target file will have specified access mode.- Parameters:
targetPath
- file path, relative to installation rootsourcePath
- path to source file which will be copied to target pathaccessMode
- Unix access mode of the file (must be an integer in range from 0 to 0777)
-
RegularFile
Create a regular file object, which contents will be populated from a byte array. Target file will have specified access mode- Parameters:
targetPath
- file path, relative to installation rootcontent
- array of bytes used to populate target file contents withaccessMode
- Unix access mode of the file (must be an integer in range from 0 to 0777)
-
RegularFile
Create a regular file object, which contents will be populated from an input stream. Target file will have specified access mode- Parameters:
targetPath
- file path, relative to installation rootcontent
- provider of array of bytes used to populate target file contents withaccessMode
- Unix access mode of the file (must be an integer in range from 0 to 0777)
-
-
Method Details
-
installContents
Description copied from class:File
Install the file into specified location.Implementations of this method can assume that all parent directory of target file already exists. Access mode of target file doesn't have to be set as it will be manipulated with other means.
- Specified by:
installContents
in classFile
- Parameters:
targetPath
- absolute path to the target file- Throws:
IOException
-