public static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".mv.db")) create = true; return create; }
/** * Writes a list of strings to a file, one per line. */ public static void write(String fileName, Iterable<String> list) throws IOException { write(fileName, list, identityTransformer); }
/** * List the files contained in a directory. */ public static String[] lsFiles(String directory) throws IOException { return lsFiles(directory, new FilenameFilter() { @Override public boolean accept(File dir, String name) { return true; } }); }
/** * Creates a new ListFeatureExtractor * * @param listName The name of the list, which is emitted as the feature * @param listFile A file containing the elements of the list * @param caseSensitive Should the checking be case sensitive? * @throws java.io.FileNotFoundException */ public ListFeatureExtractor(String listName, String listFile, boolean caseSensitive) throws FileNotFoundException { this(listName, LineIO.read(listFile), caseSensitive); }
/** * @throws Exception */ private void updateCurrentFiles() throws Exception { currentSectionFiles = IOUtils.ls(combinedWSJHome + "/" + sections[currentSectionId]); currentSectionId++; }
/** * An implementation of {@code readGZip(String, Transformer<String, T>)}. This function reads * the lines in a gzipped file and returns them. * * @param fileName The name of the file to be read * @return An arraylist of the lines of the file. */ public static ArrayList<String> readGZip(String fileName) throws IOException { return readGZip(fileName, identityTransformer); }
/** * Writes a list of strings to a file gzipped, one per line. */ public static void writeGzip(String fileName, Iterable<String> list) throws IOException { writeGZip(fileName, list, identityTransformer); }
private static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".h2.db")) create = true; return create; }
/** * An implementation of {@code read(String, Transformer<String, T>)}. This function reads the * lines in a file and returns them. * * @param fileName The name of the file to be read * @return An arraylist of the lines of the file. */ public static ArrayList<String> read(String fileName, String charsetName) throws FileNotFoundException { return read(fileName, charsetName, identityTransformer); }
/** * Writes a list of strings to a file, one per line. */ public static void write(String fileName, Iterable<String> list) throws IOException { write(fileName, list, identityTransformer); }
/** * List the files contained in a directory. */ public static String[] lsFiles(String directory) throws IOException { return lsFiles(directory, new FilenameFilter() { @Override public boolean accept(File dir, String name) { return true; } }); }
/** * @throws Exception */ private void updateCurrentFiles() throws Exception { currentSectionFiles = IOUtils.ls(combinedWSJHome + "/" + sections[currentSectionId]); currentSectionId++; }
/** * An implementation of {@code readGZip(String, Transformer<String, T>)}. This function reads * the lines in a gzipped file and returns them. * * @param fileName The name of the file to be read * @return An arraylist of the lines of the file. */ public static ArrayList<String> readGZip(String fileName) throws IOException { return readGZip(fileName, identityTransformer); }
/** * Writes a list of strings to a file gzipped, one per line. */ public static void writeGzip(String fileName, Iterable<String> list) throws IOException { writeGZip(fileName, list, identityTransformer); }
/** * An implementation of {@code read(String, Transformer<String, T>)}. This function reads the * lines in a file and returns them. * * @param fileName The name of the file to be read * @return An arraylist of the lines of the file. */ public static ArrayList<String> read(String fileName, String charsetName) throws FileNotFoundException { return read(fileName, charsetName, identityTransformer); }
public static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".h2.db")) create = true; return create; }
private static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".h2.db")) create = true; return create; }
public static boolean dbFileExists(String dbFile) { boolean create = false; if (!IOUtils.exists(dbFile + ".mv.db")) create = true; return create; }