Package com.robustaweb.library.commons.exception

Examples of com.robustaweb.library.commons.exception.FileException


     */
    public static void createDirectory(String rootPath, String directoryName) throws FileException {
        File f = new File(rootPath + "/" + directoryName);
        boolean result;
        if (f.exists()) {
            throw new FileException("Directory already exists");
        } else {
            result = f.mkdir();
            if (!result) {
                throw new FileException("Directory could not be created for unknown reason");
            }
        }
    }
View Full Code Here


                } else {
                    ///      System.out.println("FILE TO DELETE : " + files[i].getPath() + " - " + files[i].delete());
                }
            }
        } else {
            throw new FileException("The path :'" + path + "' does't exist ");
        }

        if (!path.delete()) {
            throw new FileException("Could not delete path " + path + "!");

        } else {
            //nothing to do, it's ok
        }
View Full Code Here

     */
    static public boolean deleteFile(String path) throws FileException {

        File f = new File(path);
        if (f == null || !f.exists()) {
            throw new FileException("Can't find the file at path : " + path);
        } else {
            return f.delete();
        }

    }
View Full Code Here

TOP

Related Classes of com.robustaweb.library.commons.exception.FileException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.