Code example for File

Methods: canRead, getName, isFile

0
     * cannot be read 
     */ 
    public FilePartSource(File file) throws FileNotFoundException {
        this.file = file;
        if (file != null) {
            if (!file.isFile()) {
                throw new FileNotFoundException("File is not a normal file.");
            } 
            if (!file.canRead()) {
                throw new FileNotFoundException("File is not readable.");
            } 
            this.fileName = file.getName();       
        } 
    } 
 
    /** 
     * Constructor for FilePartSource. 
     *  
     * @param fileName the file name of the FilePart 
     * @param file the source File for the FilePart 
     *