Package net.schmizz.sshj.sftp
Enum OpenMode
- java.lang.Object
-
- java.lang.Enum<OpenMode>
-
- net.schmizz.sshj.sftp.OpenMode
-
-
Enum Constant Summary
Enum Constants Enum Constant Description APPENDForce all writes to append data at the end of the file.CREATIf this flag is specified, then a new file will be created if one does not already exist (ifTRUNCis specified, the new file will be truncated to zero length if it previously exists).EXCLCauses the request to fail if the named file already exists.READOpen the file for reading.TRUNCForces an existing file with the same name to be truncated to zero length when creating a file by specifyingCREAT.WRITEOpen the file for writing.
-
Method Summary
Modifier and Type Method Description static inttoMask(java.util.Set<OpenMode> modes)static OpenModevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static OpenMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
READ
public static final OpenMode READ
Open the file for reading.
-
WRITE
public static final OpenMode WRITE
Open the file for writing. If both this andREADare specified, the file is opened for both reading and writing.
-
APPEND
public static final OpenMode APPEND
Force all writes to append data at the end of the file.
-
CREAT
public static final OpenMode CREAT
If this flag is specified, then a new file will be created if one does not already exist (ifTRUNCis specified, the new file will be truncated to zero length if it previously exists).
-
TRUNC
public static final OpenMode TRUNC
-
-
Method Detail
-
values
public static OpenMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static OpenMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
toMask
public static int toMask(java.util.Set<OpenMode> modes)
-
-