Package com.google.common.jimfs
Class FileFactory
java.lang.Object
com.google.common.jimfs.FileFactory
Factory for creating new files and copying files. One piece of the file store implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final class
private final class
private final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.base.Supplier
<Directory> private final HeapDisk
private final FileTimeSource
private final AtomicInteger
private final com.google.common.base.Supplier
<RegularFile> -
Constructor Summary
ConstructorsConstructorDescriptionFileFactory
(HeapDisk disk, FileTimeSource fileTimeSource) Creates a new file factory using the given disk for regular files and the given time source. -
Method Summary
Modifier and TypeMethodDescriptioncopyWithoutContent
(File file) Creates and returns a copy of the given file.Creates a new directory.(package private) RegularFile
Creates a new regular file.createRootDirectory
(Name name) Creates a new root directory with the given name.(package private) SymbolicLink
createSymbolicLink
(JimfsPath target) Creates a new symbolic link referencing the given target path.com.google.common.base.Supplier
<Directory> Returns a supplier that creates directories.private int
com.google.common.base.Supplier
<RegularFile> Returns a supplier that creates regular files.com.google.common.base.Supplier
<SymbolicLink> symbolicLinkCreator
(JimfsPath target) Returns a supplier that creates a symbolic links to the given path.
-
Field Details
-
idGenerator
-
disk
-
fileTimeSource
-
directorySupplier
-
regularFileSupplier
-
-
Constructor Details
-
FileFactory
Creates a new file factory using the given disk for regular files and the given time source.
-
-
Method Details
-
nextFileId
private int nextFileId() -
createDirectory
Creates a new directory. -
createRootDirectory
Creates a new root directory with the given name. -
createRegularFile
RegularFile createRegularFile()Creates a new regular file. -
createSymbolicLink
Creates a new symbolic link referencing the given target path. -
copyWithoutContent
Creates and returns a copy of the given file.- Throws:
IOException
-
directoryCreator
Returns a supplier that creates directories. -
regularFileCreator
Returns a supplier that creates regular files. -
symbolicLinkCreator
Returns a supplier that creates a symbolic links to the given path.
-