public class FilePathUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FilePathUtil.Read
Get a file contents.
|
Constructor and Description |
---|
FilePathUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
differ(hudson.FilePath filePath1,
hudson.FilePath filePath2)
Check if two files are equal.
|
static boolean |
differ(hudson.FilePath filePath,
String content)
Check if remote file contains the provided content.
|
static hudson.FilePath |
existsOrNull(hudson.FilePath... filePaths)
Get the first existing file or directory.
|
static boolean |
isDirectory(hudson.FilePath filePath)
Check if the provided path is a directory
|
static hudson.FilePath |
isDirectoryOrNull(hudson.FilePath... filePaths)
Get the first existing directory.
|
static boolean |
isFile(hudson.FilePath filePath)
Check if the provided path is a file
|
static hudson.FilePath |
isFileOrNull(hudson.FilePath... filePaths)
Get the first existing file.
|
static boolean |
isUnix(hudson.FilePath filePath)
Is this file located on UNIX?
|
static boolean |
isWindows(hudson.FilePath filePath)
Is this file located on Windows?
|
static List<hudson.FilePath> |
listSharedLibraries(hudson.FilePath filePath)
List shared libraries contained in this folder.
|
static List<hudson.FilePath> |
listSharedLibraries(Python interpreter)
List the shared libraries of the provided interpreter.
|
static String |
read(hudson.FilePath filePath,
String encoding)
Get the content of the provided file path.
|
static hudson.FilePath |
synchronize(hudson.FilePath src,
hudson.FilePath dest)
Synchronize a file or all files in a directory.
|
static hudson.FilePath |
synchronize(hudson.FilePath filePath,
String content)
Synchronize a file or all files in a directory.
|
public static boolean isWindows(hudson.FilePath filePath) throws IOException, InterruptedException
filePath
- The file to checkIOException
InterruptedException
public static boolean isUnix(hudson.FilePath filePath) throws IOException, InterruptedException
filePath
- The file to checkIOException
InterruptedException
public static String read(hudson.FilePath filePath, String encoding) throws IOException, InterruptedException
filePath
- The file pathencoding
- The encodingIOException
InterruptedException
public static hudson.FilePath existsOrNull(hudson.FilePath... filePaths) throws IOException, InterruptedException
filePaths
- The list of files or directories to checkIOException
InterruptedException
public static hudson.FilePath isDirectoryOrNull(hudson.FilePath... filePaths) throws IOException, InterruptedException
filePaths
- The list of directories to checkIOException
InterruptedException
public static hudson.FilePath isFileOrNull(hudson.FilePath... filePaths) throws IOException, InterruptedException
filePaths
- The list of files to checkIOException
InterruptedException
public static boolean differ(hudson.FilePath filePath1, hudson.FilePath filePath2) throws IOException, InterruptedException
filePath1
- The first filefilePath2
- The second fileIOException
InterruptedException
public static boolean differ(hudson.FilePath filePath, String content) throws IOException, InterruptedException
filePath
- The first filecontent
- The contentIOException
InterruptedException
public static boolean isFile(hudson.FilePath filePath) throws IOException, InterruptedException
filePath
- The file to checkIOException
InterruptedException
public static boolean isDirectory(hudson.FilePath filePath) throws IOException, InterruptedException
filePath
- The path to checkIOException
InterruptedException
public static hudson.FilePath synchronize(hudson.FilePath filePath, String content) throws IOException, InterruptedException
filePath
- The file to synchronizecontent
- The content to synchronizeIOException
InterruptedException
public static hudson.FilePath synchronize(hudson.FilePath src, hudson.FilePath dest) throws IOException, InterruptedException
src
- The source file or directorydest
- The destination file or directoryIOException
InterruptedException
public static List<hudson.FilePath> listSharedLibraries(Python interpreter) throws IOException, InterruptedException
interpreter
- The interpreterInterruptedException
IOException
public static List<hudson.FilePath> listSharedLibraries(hudson.FilePath filePath) throws IOException, InterruptedException
filePath
- The folderIOException
InterruptedException
Copyright © 2004-2018. All Rights Reserved.