Here you can find the source of checkDir(final String name)
Parameter | Description |
---|---|
name | the name of the directory |
inFile | the directory |
public static boolean checkDir(final String name)
//package com.java2s; /*/* w ww. ja v a 2s.c o m*/ * Copyright 2014 Elhuyar Fundazioa This file is part of EliXa. EliXa is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. EliXa is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with EliXa. If not, see <http://www.gnu.org/licenses/>. */ import java.io.File; public class Main { /** * Check input directory integrity. * @param name * the name of the directory * @param inFile * the directory */ public static boolean checkDir(final String name) { return checkDir(new File(name)); } /** * Check input directory integrity. * @param name * the name of the directory * @param inFile * the directory */ public static boolean checkDir(final File f) { boolean isFailure = true; if (!f.isDirectory()) { isFailure = false; } else if (!f.canRead()) { isFailure = false; } return isFailure; } }