Package org.geowebcache.storage

Examples of org.geowebcache.storage.StorageException


    }

    private Long getOrInsert(String key, Map<String, Long> map, int maxSize, String table)
            throws StorageException {
        if (key.length() > 254) {
            throw new StorageException("Value is too big for table " + table + ":" + key);
        }

        Long res = null;
        try {
            res = doSelect(table, key);
View Full Code Here


        try {
            wrpr = new JDBCMBWrapper(driverClass, jdbcString, username, password,
                    useConnectionPooling, maxConnections);
        } catch (SQLException se) {
            enabled = false;
            throw new StorageException(se.getMessage());
        }

        if (enabled) {
            idCache = new JDBCMBIdCache(wrpr);
        } else {
View Full Code Here

        if (wrpr.driverClass.equals("org.h2.Driver")) {
            // TODO
            // wrpr.getConnection().getMetaData().get
            // DeleteDbFiles.execute(findTempDir(), TESTDB_NAME, true);
            // } else {
            throw new StorageException("clear() has not been implemented for " + wrpr.driverClass);
        }

    }
View Full Code Here

   
    public FilePathFilter(TileRange trObj) throws StorageException {
        this.tr = trObj;
       
        if(tr.gridSetId == null) {
            throw new StorageException("Specifying the grid set id is currently mandatory.");
        }
      
        gridSetPrefix = FilePathGenerator.filteredGridSetId(tr.gridSetId);

        if(tr.mimeType != null) {
View Full Code Here

    public FileBlobStore(String rootPath) throws StorageException {
        path = rootPath;
        File fh = new File(path);

        if (!fh.exists() || !fh.isDirectory() || !fh.canWrite()) {
            throw new StorageException(path + " is not writable directory.");
        }
        stagingArea = new File(path, "_gwc_in_progress_deletes_");
        createDeleteExecutorService();
        issuePendingDeletes();
    }
View Full Code Here

        if (!layerPath.exists() || !layerPath.canWrite()) {
            log.info(layerPath + " does not exist or is not writable");
            return false;
        }
        if (!stagingArea.exists() && !stagingArea.mkdirs()) {
            throw new StorageException("Can't create staging directory for deletes: "
                    + stagingArea.getAbsolutePath());
        }
        String dirName = FilePathGenerator.filteredLayerName(layerName);
        File tmpFolder = new File(stagingArea, dirName);
        int tries = 0;
View Full Code Here

            throws StorageException {
        final File oldLayerPath = getLayerPath(oldLayerName);
        final File newLayerPath = getLayerPath(newLayerName);

        if (newLayerPath.exists()) {
            throw new StorageException("Can't rename layer directory " + oldLayerPath + " to "
                    + newLayerPath + ". Target directory already exists");
        }
        if (!oldLayerPath.exists()) {
            this.listeners.sendLayerRenamed(oldLayerName, newLayerName);
            return true;
        }
        if (!oldLayerPath.canWrite()) {
            log.info(oldLayerPath + " is not writable");
            return false;
        }
        boolean renamed = oldLayerPath.renameTo(newLayerPath);
        if (renamed) {
            this.listeners.sendLayerRenamed(oldLayerName, newLayerName);
        } else {
            throw new StorageException("Couldn't rename layer directory " + oldLayerPath + " to "
                    + newLayerPath);
        }
        return renamed;
    }
View Full Code Here

        // ceiling. File.length() returns 0 if the file does not exist anyway
        final long length = fh.length();
        final boolean exists = length > 0;
        if (exists) {
            if (!fh.delete()) {
                throw new StorageException("Unable to delete " + fh.getAbsolutePath());
            }
            stObj.setBlobSize((int) length);
            listeners.sendTileDeleted(stObj);

            ret = true;
View Full Code Here

        if (!layerPath.exists()) {
            return true;
        }
        if (!layerPath.isDirectory() || !layerPath.canWrite()) {
            throw new StorageException(prefix + " does is not a directory or is not writable.");
        }
        FilePathFilter fpf = new FilePathFilter(trObj);

        final String layerName = trObj.layerName;
        final String gridSetId = trObj.gridSetId;
View Full Code Here

        // Open the output stream
        FileOutputStream fos;
        try {
            fos = new FileOutputStream(target);
        } catch (FileNotFoundException ioe) {
            throw new StorageException(ioe.getMessage() + " for " + target.getAbsolutePath());
        }

        FileChannel channel = fos.getChannel();
        try {
            source.transferTo(channel);
        } catch (IOException ioe) {
            throw new StorageException(ioe.getMessage() + " for " + target.getAbsolutePath());
        } finally {
            try {
                channel.close();
            } catch (IOException ioe) {
                throw new StorageException(ioe.getMessage() + " for " + target.getAbsolutePath());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.geowebcache.storage.StorageException

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.