Package ca.pgon.saviorlib.Exceptions

Examples of ca.pgon.saviorlib.Exceptions.FileSystemException


    @Override
    public InputStream readFile(FileEntry file) {
        try {
            return new FileInputStream(FileSystemTools.getAbsolutePath(file, basePath));
        } catch (Exception ex) {
            throw new FileSystemException("Could not read the file ", ex);
        }
    }
View Full Code Here


        try {
            FileInputStream in = new FileInputStream(FileSystemTools.getAbsolutePath(file, basePath));
            in.skip(offset);
            return in;
        } catch (Exception ex) {
            throw new FileSystemException("Could not read the file ", ex);
        }
    }
View Full Code Here

    @Override
    public void changeFileModificationTime(FileEntry file, long time) {
        File f = new File(FileSystemTools.getAbsolutePath(file, basePath));
        if (!f.setLastModified(time)) {
            throw new FileSystemException("Could not change the modification time of the file");
        }
    }
View Full Code Here

            }

            in.close();
            return bytesToHex(digest.digest());
        } catch (NoSuchAlgorithmException ex) {
            throw new FileSystemException("Cannot use MD5");
        } catch (IOException ex) {
            throw new FileSystemException("Error reading file", ex);
        }
       
    }
View Full Code Here

TOP

Related Classes of ca.pgon.saviorlib.Exceptions.FileSystemException

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.