public class Environment extends Object
Constructor and Description |
---|
Environment(Settings settings) |
Modifier and Type | Method and Description |
---|---|
Path |
binFile() |
Path |
configFile()
The config location.
|
Path[] |
dataFiles()
The data location.
|
Path[] |
dataWithClusterFiles()
The data location with the cluster name as a sub directory.
|
static FileStore |
getFileStore(Path path)
Looks up the filestore associated with a Path.
|
static boolean |
isWritable(Path path)
Returns true if the path is writable.
|
Path |
libFile() |
Path |
logsFile() |
Path |
modulesFile() |
Path |
pidFile()
The PID file location (can be null if no PID file is configured)
|
Path |
pluginsFile() |
Path[] |
repoFiles()
The shared filesystem repo locations.
|
Path |
resolveRepoFile(String location)
Resolves the specified location against the list of configured repository roots
If the specified location doesn't match any of the roots, returns null.
|
URL |
resolveRepoURL(URL url)
Checks if the specified URL is pointing to the local file system and if it does, resolves the specified url
against the list of configured repository roots
If the specified url doesn't match any of the roots, returns null.
|
Path |
scriptsFile()
Location of on-disk scripts
|
Settings |
settings()
The settings used to build this environment.
|
Path |
sharedDataFile()
The shared data location
|
Path |
tmpFile()
Path to the default temp directory used by the JDK
|
public Environment(Settings settings)
public Settings settings()
public Path[] dataFiles()
public Path sharedDataFile()
public Path[] dataWithClusterFiles()
public Path[] repoFiles()
public Path resolveRepoFile(String location)
public URL resolveRepoURL(URL url)
public Path configFile()
public Path scriptsFile()
public Path pluginsFile()
public Path binFile()
public Path libFile()
public Path modulesFile()
public Path logsFile()
public Path pidFile()
public Path tmpFile()
public static FileStore getFileStore(Path path) throws IOException
This is an enhanced version of Files.getFileStore(Path)
:
ext4
) instead of rootfs
.
lucene:spins
is supported
via the FileStore.getAttribute(String)
method.
Files.getFileStore(Path)
,
no permissions to the actual mount point are required.
Files.getFileStore(Path)
.
IOException
public static boolean isWritable(Path path) throws IOException
Files.isWritable(Path)
, except won't
falsely return false for paths on SUBST'd drive letters
See https://bugs.openjdk.java.net/browse/JDK-8034057
Note this will set the file modification time (to its already-set value)
to test access.IOException
Copyright © 2009–2016. All rights reserved.