public class FileOps extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FileOps.Filter_EndsWith |
static interface |
FileOps.LineReader |
Modifier and Type | Field and Description |
---|---|
static StandardCopyOption[] |
COPYOPTS_ATOMIC |
static StandardCopyOption[] |
COPYOPTS_NONE |
static StandardCopyOption[] |
COPYOPTS_REPLACE |
static FileAttribute<?>[] |
FATTR_NONE |
static LinkOption[] |
LINKOPTS_NONE |
static StandardOpenOption[] |
OPENOPTS_CREATE |
static StandardOpenOption[] |
OPENOPTS_CREATE_DSYNC |
static StandardOpenOption[] |
OPENOPTS_CREATE_WRITE |
static StandardOpenOption[] |
OPENOPTS_CREATE_WRITE_TRUNC |
static StandardOpenOption[] |
OPENOPTS_CREATNEW |
static StandardOpenOption[] |
OPENOPTS_CREATNEW_DSYNC |
static StandardOpenOption[] |
OPENOPTS_DSYNC |
static StandardOpenOption[] |
OPENOPTS_NONE |
static StandardOpenOption[] |
OPENOPTS_READ |
static String |
URLPFX_FILE |
static String |
URLPFX_HTTP |
static String |
URLPFX_HTTPS |
static String |
URLPFX_JAR |
Constructor and Description |
---|
FileOps() |
Modifier and Type | Method and Description |
---|---|
static boolean |
close(Object obj) |
static long |
copyFile(CharSequence srcpath,
CharSequence dstpath) |
static long |
copyFile(Path srcfile,
Path dstfile) |
static int |
copyStream(InputStream istrm,
OutputStream ostrm) |
static int |
countFiles(File dirh,
boolean recursive) |
static int |
countFiles(File dirh,
boolean stopOnFirst,
boolean recursive) |
static int |
countFiles(File dirh,
FileFilter filter,
boolean stopOnFirst,
boolean recursive) |
static int |
countFiles(File dirh,
FilenameFilter filter,
boolean stopOnFirst,
boolean recursive) |
static int |
deleteDirectory(File dirh) |
static int |
deleteDirectory(String pthnam) |
static void |
deleteFile(File fh) |
static IOException |
deleteFile(Path fh) |
static int |
deleteOlderThan(File dirh,
long min_age,
FileFilter filter,
boolean recursive) |
static ArrayList<Path> |
directoryList(Path dirh,
boolean recursive) |
static ArrayList<String> |
directoryListSimple(Path dirh) |
static ArrayList<String> |
directoryListSimple(Path dirh,
int max,
ArrayList<String> lst) |
static void |
ensureDirExists(File dirh) |
static void |
ensureDirExists(Path dirh) |
static void |
ensureDirExists(String pthnam) |
static boolean |
flush(Object obj) |
static String |
getFilename(Path fh) |
static String |
getFileType(String filename) |
static URL |
makeURL(String pthnam) |
static void |
moveFile(CharSequence srcpath,
CharSequence dstpath) |
static void |
moveFile(File srcfile,
File dstfile) |
static Path |
parentDirectory(Path fh) |
static ByteArrayRef |
read(CharSequence pthnam_cs,
int reqlen,
ByteArrayRef bufh) |
static ByteArrayRef |
read(File fh) |
static ByteArrayRef |
read(File fh,
int reqlen,
ByteArrayRef bufh) |
static ByteArrayRef |
read(InputStream istrm,
int reqlen,
ByteArrayRef bufh) |
static ByteArrayRef |
read(Path fh) |
static ByteArrayRef |
read(Path fh,
int reqlen,
ByteArrayRef bufh) |
static ByteArrayRef |
read(URL url,
int reqlen,
ByteArrayRef bufh) |
static String |
readAsText(CharSequence pthnam_cs,
String charset) |
static String |
readAsText(File fh,
String charset) |
static String |
readAsText(InputStream strm,
String charset) |
static String |
readAsText(Path fh,
String charset) |
static String |
readAsText(URL url,
String charset) |
static byte[] |
readResource(String path,
Class<?> clss) |
static String |
readResourceAsText(String path,
Class<?> clss,
String charset) |
static int |
readTextLines(File fh,
FileOps.LineReader consumer,
int bufsiz,
String cmnt,
int mode,
Object cbdata) |
static int |
readTextLines(InputStream strm,
FileOps.LineReader consumer,
int bufsiz,
String cmnt,
int mode,
Object cbdata) |
static int |
readTextLines(Path fh,
FileOps.LineReader consumer,
int bufsiz,
String cmnt,
int mode,
Object cbdata) |
static int |
readTextLines(URL path,
FileOps.LineReader consumer,
int bufsiz,
String cmnt,
int mode,
Object cbdata) |
static PrintStream |
redirectStdio(CharSequence pthnam,
boolean autoflush,
boolean stdout,
boolean stderr) |
static void |
sortByFilename(ArrayList<Path> paths) |
static void |
sortByFilename(Path[] paths) |
static void |
sortByFilename(Path[] paths,
int off,
int len) |
static void |
writeTextFile(File fh,
String txt,
boolean append) |
static void |
writeTextFile(String pthnam,
String txt) |
public static final String URLPFX_HTTP
public static final String URLPFX_HTTPS
public static final String URLPFX_JAR
public static final String URLPFX_FILE
public static final StandardOpenOption[] OPENOPTS_NONE
public static final StandardCopyOption[] COPYOPTS_NONE
public static final LinkOption[] LINKOPTS_NONE
public static final FileAttribute<?>[] FATTR_NONE
public static final StandardOpenOption[] OPENOPTS_CREATE
public static final StandardOpenOption[] OPENOPTS_CREATNEW
public static final StandardOpenOption[] OPENOPTS_READ
public static final StandardOpenOption[] OPENOPTS_DSYNC
public static final StandardOpenOption[] OPENOPTS_CREATE_DSYNC
public static final StandardOpenOption[] OPENOPTS_CREATNEW_DSYNC
public static final StandardOpenOption[] OPENOPTS_CREATE_WRITE
public static final StandardOpenOption[] OPENOPTS_CREATE_WRITE_TRUNC
public static final StandardCopyOption[] COPYOPTS_REPLACE
public static final StandardCopyOption[] COPYOPTS_ATOMIC
public static ByteArrayRef read(Path fh) throws IOException
IOException
public static void ensureDirExists(String pthnam) throws IOException
IOException
public static ArrayList<String> directoryListSimple(Path dirh) throws IOException
IOException
public static void sortByFilename(Path[] paths)
public static void writeTextFile(String pthnam, String txt) throws IOException
IOException
public static int deleteDirectory(String pthnam) throws IOException
IOException
public static ByteArrayRef read(File fh) throws IOException
IOException
public static ByteArrayRef read(File fh, int reqlen, ByteArrayRef bufh) throws IOException
IOException
public static String readAsText(File fh, String charset) throws IOException
IOException
public static void ensureDirExists(File dirh) throws IOException
IOException
public static ByteArrayRef read(InputStream istrm, int reqlen, ByteArrayRef bufh) throws IOException
IOException
public static ByteArrayRef read(Path fh, int reqlen, ByteArrayRef bufh) throws IOException
IOException
public static ByteArrayRef read(URL url, int reqlen, ByteArrayRef bufh) throws IOException
IOException
public static ByteArrayRef read(CharSequence pthnam_cs, int reqlen, ByteArrayRef bufh) throws IOException
IOException
public static byte[] readResource(String path, Class<?> clss) throws IOException
IOException
public static String readResourceAsText(String path, Class<?> clss, String charset) throws IOException
IOException
public static String readAsText(InputStream strm, String charset) throws IOException
IOException
public static String readAsText(Path fh, String charset) throws IOException
IOException
public static String readAsText(URL url, String charset) throws IOException
IOException
public static String readAsText(CharSequence pthnam_cs, String charset) throws IOException
IOException
public static void writeTextFile(File fh, String txt, boolean append) throws IOException
IOException
public static int readTextLines(InputStream strm, FileOps.LineReader consumer, int bufsiz, String cmnt, int mode, Object cbdata) throws IOException
IOException
public static int readTextLines(Path fh, FileOps.LineReader consumer, int bufsiz, String cmnt, int mode, Object cbdata) throws IOException
IOException
public static int readTextLines(File fh, FileOps.LineReader consumer, int bufsiz, String cmnt, int mode, Object cbdata) throws IOException
IOException
public static int readTextLines(URL path, FileOps.LineReader consumer, int bufsiz, String cmnt, int mode, Object cbdata) throws IOException
IOException
public static long copyFile(Path srcfile, Path dstfile) throws IOException
IOException
public static long copyFile(CharSequence srcpath, CharSequence dstpath) throws IOException
IOException
public static void moveFile(File srcfile, File dstfile) throws IOException
IOException
public static void moveFile(CharSequence srcpath, CharSequence dstpath) throws IOException
IOException
public static void deleteFile(File fh) throws IOException
IOException
public static IOException deleteFile(Path fh)
public static int copyStream(InputStream istrm, OutputStream ostrm) throws IOException
IOException
public static boolean close(Object obj) throws IOException
IOException
public static boolean flush(Object obj) throws IOException
IOException
public static PrintStream redirectStdio(CharSequence pthnam, boolean autoflush, boolean stdout, boolean stderr) throws IOException
IOException
public static URL makeURL(String pthnam) throws MalformedURLException
MalformedURLException
public static ArrayList<Path> directoryList(Path dirh, boolean recursive) throws IOException
IOException
public static ArrayList<String> directoryListSimple(Path dirh, int max, ArrayList<String> lst) throws IOException
IOException
public static int countFiles(File dirh, boolean recursive)
public static int countFiles(File dirh, boolean stopOnFirst, boolean recursive)
public static int countFiles(File dirh, FileFilter filter, boolean stopOnFirst, boolean recursive)
public static int countFiles(File dirh, FilenameFilter filter, boolean stopOnFirst, boolean recursive)
public static int deleteOlderThan(File dirh, long min_age, FileFilter filter, boolean recursive) throws IOException
IOException
public static int deleteDirectory(File dirh) throws IOException
IOException
public static void ensureDirExists(Path dirh) throws IOException
IOException
public static void sortByFilename(Path[] paths, int off, int len)
Copyright 2010-2018 Grey Software (Yusef Badri). All Rights Reserved.