@Test public void testContainsSubdirectory() { boolean conditionTrue = FileUtil.containsSubdirectory(fileDir, "xml"); assertTrue(conditionTrue); boolean conditionFalse = FileUtil.containsFile(fileDir, "boo"); assertFalse(conditionFalse); }
public static boolean containsSubdirectory(File directory, String subdirName) { File[] files = directory.listFiles(new FileFilter() { @Override public boolean accept(File f) { return f.isDirectory() && f.getName().equals(subdirName); } }); return files.length != 0; }
FileUtil { public static boolean containsSubdirectory(File directory, String subdirName) { File[] files = directory.listFiles(new FileFilter() { @Override public boolean accept(File f) { return f.isDirectory() && f.getName().equals(subdirName); } }); return files.length != 0; } }
FileUtil { public static boolean containsSubdirectory(File directory, String subdirName) { File[] files = directory.listFiles(new FileFilter() { @Override public boolean accept(File f) { return f.isDirectory() && f.getName().equals(subdirName); } }); return files.length != 0; }  }
FileUtil { public static boolean containsSubdirectory(File directory, String subdirName) { File[] files = directory.listFiles(new FileFilter() { @Override public boolean accept(File f) { return f.isDirectory() && f.getName().equals(subdirName); } }); return files.length != 0; }  static File newFile(File directory, String fileName); static InputStream newFileInputStream(File directory, String fileName); static InputStream newFileInputStream(File file); static boolean containsFile(File directory, String fileName); static boolean containsSubdirectory(File directory, String subdirName); static File[] getSubdirectories(File directory); static void convertToUtf8(String inputFile, String outputFile, String actualCharset); static void convertToUtf8(File in, File out, String actualCharset); static void convertEncoding(String inputFile, String outputFile, String actualCharset,
			String desiredCharset); @Deprecated static void convertEncoding_old(File in, File out, String actualCharset,
			String desiredCharset); static void convertEncoding(File in, File out, String actualCharset,
			String desiredCharset); static String getContents(String path); static String getContents(String path, String charset); static byte[] getByteContents(String path); static String getContents(File file); static String getContents(File file, String charset); static String getContents(InputStream is); static String getContents(URL url, String charset); static void setContents(String path, String contents); static void setContents(String path, String contents, String charset); static void setContents(String path, byte[] contents); static void setContents(File file, String contents); static void setContents(File file, String contents, String charset); static void setContents(File file, InputStream contents); static void setContents(File file, InputStream contents, int bufsize); static void setContents(File file, byte[] contents); static void addContent(String path, String contents); static void addContent(String path, String contents, String charset); static void addContent(File file, String content); static void addContent(File file, String content, String charset); static void addContent(File file, InputStream contents, int bufsize); static void addContent(File file, byte[] content); static void setContents(File file, InputStream contents, int bufsize, boolean append); static void log(String message, Object... messageArgs); static void log(File file, String message, Object... messageArgs); static void delete(String path); }
FileUtil { public static boolean containsSubdirectory(File directory, String subdirName) { File[] files = directory.listFiles(new FileFilter() { @Override public boolean accept(File f) { return f.isDirectory() && f.getName().equals(subdirName); } }); return files.length != 0; }  static File newFile(File directory, String fileName); static InputStream newFileInputStream(File directory, String fileName); static InputStream newFileInputStream(File file); static boolean containsFile(File directory, String fileName); static boolean containsSubdirectory(File directory, String subdirName); static File[] getSubdirectories(File directory); static void convertToUtf8(String inputFile, String outputFile, String actualCharset); static void convertToUtf8(File in, File out, String actualCharset); static void convertEncoding(String inputFile, String outputFile, String actualCharset,
			String desiredCharset); @Deprecated static void convertEncoding_old(File in, File out, String actualCharset,
			String desiredCharset); static void convertEncoding(File in, File out, String actualCharset,
			String desiredCharset); static String getContents(String path); static String getContents(String path, String charset); static byte[] getByteContents(String path); static String getContents(File file); static String getContents(File file, String charset); static String getContents(InputStream is); static String getContents(URL url, String charset); static void setContents(String path, String contents); static void setContents(String path, String contents, String charset); static void setContents(String path, byte[] contents); static void setContents(File file, String contents); static void setContents(File file, String contents, String charset); static void setContents(File file, InputStream contents); static void setContents(File file, InputStream contents, int bufsize); static void setContents(File file, byte[] contents); static void addContent(String path, String contents); static void addContent(String path, String contents, String charset); static void addContent(File file, String content); static void addContent(File file, String content, String charset); static void addContent(File file, InputStream contents, int bufsize); static void addContent(File file, byte[] content); static void setContents(File file, InputStream contents, int bufsize, boolean append); static void log(String message, Object... messageArgs); static void log(File file, String message, Object... messageArgs); static void delete(String path);  }