Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.LowlevelStorageException


            cclass = loader.loadClass(pathRegistry);
            constructor = cclass.getConstructor(parameterTypes);
            this.pathRegistry =
                    (PathRegistry) constructor.newInstance(parameters);
        } catch (Exception e) {
            LowlevelStorageException wrapper =
                    new LowlevelStorageException(true, "couldn't set up "
                            + failureReason + " for " + registryName, e);
            throw wrapper;
        }
    }
View Full Code Here


            throw new ObjectAlreadyInLowlevelStorageException(pid);
        }

        filePath = pathAlgorithm.get(pid);
        if (filePath == null || filePath.equals("")) { //guard against algorithm implementation
            throw new LowlevelStorageException(true,
                    "null path from algorithm for pid " + pid);
        }

        try {
            file = new File(filePath);
        } catch (Exception eFile) { //purposefully general catch-all
            throw new LowlevelStorageException(true,
                    "couldn't make File for " + filePath, eFile);
        }
        fileSystem.write(file, content);
        pathRegistry.put(pid, filePath);
        return file.length();
View Full Code Here

    }
   
    public final boolean exists(String pid) throws LowlevelStorageException {
        if (pathRegistry.exists(pid)){
            if (!getFile(pid).exists()) {
                throw new LowlevelStorageException(true,
                        "file not at indexed path from registry for " + pid
                        + "at " + pathRegistry.get(pid));
            }
            return true;
        } else {
View Full Code Here

    }
   
    private File getFile(String pid) throws LowlevelStorageException {
        String filePath = pathRegistry.get(pid);
        if (filePath == null || filePath.equals("")) { //guard against registry implementation
            throw new LowlevelStorageException(true,
                    "null path from registry for pid " + pid);
        }
        try {
            return new File(filePath);
        } catch (Exception eFile) { //purposefully general catch-all
            throw new LowlevelStorageException(true,
                    "couldn't make File for " + filePath, eFile);
        }
    }
View Full Code Here

    }

    private final String leftPaddedUnder100(int i)
            throws LowlevelStorageException {
        if (i < 0 || i > 99) {
            throw new LowlevelStorageException(true, getClass().getName()
                    + ": faulty date padding");
        }
        if (i < 10) {
            return PADDED[i];
        }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.errors.LowlevelStorageException

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.