Package io.roastedroot.zerofs
Class Options
- java.lang.Object
-
- io.roastedroot.zerofs.Options
-
final class Options extends java.lang.ObjectUtility methods for normalizing user-provided options arrays and sets to canonical immutable sets of options.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Set<java.nio.file.OpenOption>DEFAULT_READprivate static java.util.Set<java.nio.file.OpenOption>DEFAULT_READ_NOFOLLOW_LINKSprivate static java.util.Set<java.nio.file.OpenOption>DEFAULT_WRITEstatic java.util.Set<java.nio.file.LinkOption>FOLLOW_LINKSEmpty LinkOption set.static java.util.Set<java.nio.file.LinkOption>NOFOLLOW_LINKSSet containing LinkOption.NOFOLLOW_LINKS.
-
Constructor Summary
Constructors Modifier Constructor Description privateOptions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.util.Set<java.nio.file.OpenOption>addWrite(java.util.Collection<? extends java.nio.file.OpenOption> options)Returns anSetcopy of the givenoptions, addingStandardOpenOption#WRITEif it isn't already present.static java.util.Set<java.nio.file.CopyOption>getCopyOptions(java.nio.file.CopyOption... options)Returns an immutable set of the given options for a copy.static java.util.Set<java.nio.file.LinkOption>getLinkOptions(java.nio.file.LinkOption... options)Returns an immutable set of link options.static java.util.Set<java.nio.file.CopyOption>getMoveOptions(java.nio.file.CopyOption... options)Returns an immutable set of the given options for a move.static java.util.Set<java.nio.file.OpenOption>getOptionsForChannel(java.util.Set<? extends java.nio.file.OpenOption> options)Returns an immutable set of open options for opening a new file channel.static java.util.Set<java.nio.file.OpenOption>getOptionsForInputStream(java.nio.file.OpenOption... options)Returns an immutable set of open options for opening a new input stream.static java.util.Set<java.nio.file.OpenOption>getOptionsForOutputStream(java.nio.file.OpenOption... options)Returns an immutable set of open options for opening a new output stream.
-
-
-
Field Detail
-
NOFOLLOW_LINKS
public static final java.util.Set<java.nio.file.LinkOption> NOFOLLOW_LINKS
Set containing LinkOption.NOFOLLOW_LINKS.
-
FOLLOW_LINKS
public static final java.util.Set<java.nio.file.LinkOption> FOLLOW_LINKS
Empty LinkOption set.
-
DEFAULT_READ
private static final java.util.Set<java.nio.file.OpenOption> DEFAULT_READ
-
DEFAULT_READ_NOFOLLOW_LINKS
private static final java.util.Set<java.nio.file.OpenOption> DEFAULT_READ_NOFOLLOW_LINKS
-
DEFAULT_WRITE
private static final java.util.Set<java.nio.file.OpenOption> DEFAULT_WRITE
-
-
Method Detail
-
getLinkOptions
public static java.util.Set<java.nio.file.LinkOption> getLinkOptions(java.nio.file.LinkOption... options)
Returns an immutable set of link options.
-
getOptionsForChannel
public static java.util.Set<java.nio.file.OpenOption> getOptionsForChannel(java.util.Set<? extends java.nio.file.OpenOption> options)
Returns an immutable set of open options for opening a new file channel.
-
getOptionsForInputStream
public static java.util.Set<java.nio.file.OpenOption> getOptionsForInputStream(java.nio.file.OpenOption... options)
Returns an immutable set of open options for opening a new input stream.
-
getOptionsForOutputStream
public static java.util.Set<java.nio.file.OpenOption> getOptionsForOutputStream(java.nio.file.OpenOption... options)
Returns an immutable set of open options for opening a new output stream.
-
addWrite
private static java.util.Set<java.nio.file.OpenOption> addWrite(java.util.Collection<? extends java.nio.file.OpenOption> options)
Returns anSetcopy of the givenoptions, addingStandardOpenOption#WRITEif it isn't already present.
-
getMoveOptions
public static java.util.Set<java.nio.file.CopyOption> getMoveOptions(java.nio.file.CopyOption... options)
Returns an immutable set of the given options for a move.
-
getCopyOptions
public static java.util.Set<java.nio.file.CopyOption> getCopyOptions(java.nio.file.CopyOption... options)
Returns an immutable set of the given options for a copy.
-
-