public abstract class Platform extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Platform(String name)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getEnv(String varname)
Returns the value of an environment variable.
|
protected abstract String[] |
getGetenvArgs(String varname)
Returns an array of words to pass to
Runtime.exec(java.lang.String[]) in order
to read an environment variable name. |
abstract File |
getHomeDirectory()
Returns SAMP's definition of the "home" directory.
|
static Platform |
getPlatform()
Returns a
Platform instance for the current system. |
protected abstract String[] |
getPrivateReadArgs(File file)
Returns an array of words to pass to
Runtime.exec(java.lang.String[]) in order
to set permissions on a given file so that it cannot be read by
anyone other than its owner. |
void |
setPrivateRead(File file)
Sets file permissions on a given file so that it cannot be read by
anyone other than its owner.
|
protected Platform(String name)
name - platform namepublic abstract File getHomeDirectory()
public String getEnv(String varname)
varname - name of environment variablepublic void setPrivateRead(File file) throws IOException
file - file whose permissions are to be alteredIOException - if permissions cannot be changedprotected abstract String[] getGetenvArgs(String varname)
Runtime.exec(java.lang.String[]) in order
to read an environment variable name.
If null is returned, no way is known to do this with a system command.varname - environment variable name to readprotected abstract String[] getPrivateReadArgs(File file) throws IOException
Runtime.exec(java.lang.String[]) in order
to set permissions on a given file so that it cannot be read by
anyone other than its owner.
If null is returned, no way is known to do this with a system command.file - file to alterIOExceptionpublic static Platform getPlatform()
Platform instance for the current system.Copyright © 2008–2024. All rights reserved.