public class FileOptions
extends java.lang.Object
installFile(...)
methods of the InstallerContext
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_MODE
The default file mode on Unix and macOS ("644").
|
Constructor and Description |
---|
FileOptions()
Initializes a FileOptions instance.
|
FileOptions(long fileTime)
Initializes a FileOptions instance.
|
FileOptions(long fileTime,
OverwriteMode overwriteMode)
Initializes a FileOptions instance.
|
FileOptions(long fileTime,
java.lang.String mode,
OverwriteMode overwriteMode,
boolean shared,
boolean delayIfNecessary,
UninstallMode uninstallMode)
Initializes a FileOptions instance.
|
FileOptions(long fileTime,
java.lang.String mode,
OverwriteMode overwriteMode,
boolean shared,
UninstallMode uninstallMode)
Initializes a FileOptions instance.
|
FileOptions(OverwriteMode overwriteMode,
UninstallMode uninstallMode)
Initializes a FileOptions instance.
|
FileOptions(java.lang.String mode,
OverwriteMode overwriteMode,
boolean shared)
Initializes a FileOptions instance.
|
Modifier and Type | Method and Description |
---|---|
long |
getFileTime()
Returns the file time.
|
java.lang.String |
getMode()
Returns the unix access mode.
|
OverwriteMode |
getOverwriteMode()
Returns the overwrite mode.
|
UninstallMode |
getUninstallMode()
Returns the uninstallation mode.
|
boolean |
isDelayIfNecessary()
Returns whether the operation should be delayed until reboot on Windows if necessary.
|
boolean |
isShared()
Returns whether the file will be installed as a shared file on Windows.
|
void |
setDelayIfNecessary(boolean delayIfNecessary)
Sets whether the operation should be delayed until reboot on Windows if necessary.
|
void |
setFileTime(long fileTime)
Sets the file time.
|
void |
setMode(int intMode)
Sets the unix file mode as an integer.
|
void |
setMode(java.lang.String mode)
Sets the unix file mode as an octal string.
|
void |
setOverwriteMode(OverwriteMode overwriteMode)
Sets the overwrite mode.
|
void |
setShared(boolean shared)
Sets whether the file should be installed as shared on Windows.
|
void |
setUninstallMode(UninstallMode uninstallMode)
Sets whether the file should be uninstalled.
|
java.lang.String |
toString() |
public static final java.lang.String DEFAULT_MODE
public FileOptions()
FileOptions(new Date().getTime(),
DEFAULT_MODE, OverwriteMode.ALWAYS_ASK_EXCEPT_FOR_UPDATE, false, UninstallMode.IF_CREATED)
.public FileOptions(java.lang.String mode, OverwriteMode overwriteMode, boolean shared)
FileOptions(new Date().getTime(),
mode, overwriteMode, shared, UninstallMode.IF_CREATED)
.mode
- the mode for the destination file (e.g. "644"). This has no effect on Windows.overwriteMode
- how an existing destination file should be handled.shared
- the file will be installed as shared on Windows. This means that a reference counter will
ensure that the file won't be uninstalled if it is also used by another program. This is highly
recommended for files that will be installed in windows system directories.public FileOptions(long fileTime)
FileOptions(fileTime,
DEFAULT_MODE, OVERWRITE_ALWAYS_ASK, false, UninstallMode.IF_CREATED)
.fileTime
- the "last modified" time the file will be set to.public FileOptions(long fileTime, OverwriteMode overwriteMode)
FileOptions(fileTime,
DEFAULT_MODE, overwrite, false, UninstallMode.IF_CREATED)
.fileTime
- the "last modified" time the file will be set to.overwriteMode
- how an existing destination file should be handled.public FileOptions(long fileTime, java.lang.String mode, OverwriteMode overwriteMode, boolean shared, UninstallMode uninstallMode)
fileTime
- the "last modified" time the file will be set to.mode
- the mode for the destination file (e.g. "644"). This has no effect on Windows.overwriteMode
- how an existing destination file should be handled.shared
- the file will be installed as shared on Windows. This means that a reference counter will
ensure that the file won't be uninstalled if it is also used by another program. This is highly
recommended for files that will be installed in windows system directories.uninstallMode
- the behavior for uninstallation.public FileOptions(long fileTime, java.lang.String mode, OverwriteMode overwriteMode, boolean shared, boolean delayIfNecessary, UninstallMode uninstallMode)
fileTime
- the "last modified" time the file will be set to.mode
- the mode for the destination file (e.g. "644"). This has no effect on Windows.overwriteMode
- how an existing destination file should be handled.shared
- the file will be installed as shared on Windows. This means that a reference counter will
ensure that the file won't be uninstalled if it is also used by another program. This is highly
recommended for files that will be installed in windows system directories.delayIfNecessary
- whether the operation should be delayed until reboot on Windows if necessary.uninstallMode
- the behavior for uninstallation.public FileOptions(OverwriteMode overwriteMode, UninstallMode uninstallMode)
FileOptions(new Date().getTime(),
DEFAULT_MODE, overwriteMode, false, uninstallMode)
.overwriteMode
- how an existing destination file should be handled.uninstallMode
- the behavior for uninstallation.public long getFileTime()
java.io.File.lastModified()
.public void setFileTime(long fileTime)
java.io.File.lastModified()
.fileTime
- the new file time.public java.lang.String getMode()
public void setMode(int intMode)
intMode
- the mode as an integer (e.g. 0664).public void setMode(java.lang.String mode)
mode
- the mode as an octal string (e.g. "664").public OverwriteMode getOverwriteMode()
public void setOverwriteMode(OverwriteMode overwriteMode)
overwriteMode
- one of the OverwriteMode.* constants.public boolean isShared()
true
or false
.public void setShared(boolean shared)
shared
- true
or false
public UninstallMode getUninstallMode()
public void setUninstallMode(UninstallMode uninstallMode)
uninstallMode
- one of the UninstallMode.* constants.public boolean isDelayIfNecessary()
true
or false
.public void setDelayIfNecessary(boolean delayIfNecessary)
delayIfNecessary
- true
or false
.public java.lang.String toString()
toString
in class java.lang.Object