public class FileFunctions extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FileFunctions.GrepLineHandler |
class |
FileFunctions.LengthWarner |
class |
FileFunctions.ScreenOutputStream |
class |
FileFunctions.TextWrapper |
Modifier and Type | Field and Description |
---|---|
protected static Map<String,List<String>> |
class2source |
protected TextEditor |
parent |
Constructor and Description |
---|
FileFunctions(TextEditor parent) |
Modifier and Type | Method and Description |
---|---|
protected String[] |
append(String[] array,
String item) |
protected String[] |
append(String[] array,
String[] append) |
protected void |
copyTo(InputStream in,
OutputStream out) |
protected void |
copyTo(InputStream in,
String destination) |
protected boolean |
error(String message) |
List<String> |
extractSourceJar(String path,
File workspace) |
protected void |
findJavaPaths(File directory,
String prefix) |
static Map<String,URL> |
findResources(String regex,
Iterable<URL> urls)
Deprecated.
Use
FileUtils.findResources(String, Iterable) instead. |
static Map<String,URL> |
findResources(String regex,
String pathPrefix)
Deprecated.
Use
FileUtils.findResources(String, String, File)
instead. |
String |
findSourcePath(String className,
File workspace) |
String |
firstNLines(String text,
int maxLineCount) |
File |
getGitDirectory(File file) |
String |
getGitwebURL(File file,
File gitDirectory,
int line) |
File |
getPluginRootDirectory(File file) |
List<String> |
getResourceList(String url)
Get a list of files from a directory or within a .jar file The returned
items will only have the base path, to get at the full URL you have to
prefix the url passed to the function.
|
String |
getSourcePath(String className)
Deprecated.
Use
getSourceURL(String) instead. |
String |
getSourceURL(String className) |
String |
git(File gitDirectory,
File workingDirectory,
String... args) |
String |
git(File gitDirectory,
String... args) |
String |
gitConfig(File gitDirectory,
String key) |
void |
gitGrep(String searchTerm,
File directory) |
boolean |
isBinaryFile(String path) |
void |
listFilesRecursively(File directory,
String prefix,
List<String> result)
Get a list of files from a directory (recursively)
|
protected void |
makeParentDirectories(File file) |
void |
openInGitweb(File file,
File gitDirectory,
int line) |
protected String |
readStream(InputStream in) |
protected String |
stripSuffix(String string,
String suffix) |
protected TextEditor parent
public FileFunctions(TextEditor parent)
public List<String> extractSourceJar(String path, File workspace) throws IOException
IOException
protected void copyTo(InputStream in, String destination) throws IOException
IOException
protected void copyTo(InputStream in, OutputStream out) throws IOException
IOException
protected void makeParentDirectories(File file)
public boolean isBinaryFile(String path)
@Deprecated public String getSourcePath(String className) throws ClassNotFoundException
getSourceURL(String)
instead.ClassNotFoundException
protected String readStream(InputStream in) throws IOException
IOException
public void listFilesRecursively(File directory, String prefix, List<String> result)
public List<String> getResourceList(String url)
protected boolean error(String message)
@Deprecated public static Map<String,URL> findResources(String regex, String pathPrefix)
FileUtils.findResources(String, String, File)
instead.@Deprecated public static Map<String,URL> findResources(String regex, Iterable<URL> urls)
FileUtils.findResources(String, Iterable)
instead.Copyright © 2015–2022 SciJava. All rights reserved.