Examples of StorageException


Examples of org.geowebcache.storage.StorageException

            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

Examples of org.geowebcache.storage.StorageException

        // 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

Examples of org.geowebcache.storage.StorageException

        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

Examples of org.geowebcache.storage.StorageException

        // 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

Examples of org.geowebcache.storage.StorageException

            }
        }
    }

    public void clear() throws StorageException {
        throw new StorageException("Not implemented yet!");
    }
View Full Code Here

Examples of org.geowebcache.storage.StorageException

        this.useConnectionPooling = useConnectionPooling;
        this.maxConnections = maxConnections;
        try {
            Class.forName(driverClass);
        } catch (ClassNotFoundException cnfe) {
            throw new StorageException("Class not found: " + cnfe.getMessage());
        }

        if (!useConnectionPooling) {
            persistentConnection = getConnection();
        }
View Full Code Here

Examples of org.geowebcache.storage.StorageException

            this.jdbcString = envStrJdbcUrl;
        } else {
            String path = defStoreFind.getDefaultPath() + File.separator + "meta_jdbc_h2";
            File dir = new File(path);
            if (!dir.exists() && !dir.mkdirs()) {
                throw new StorageException("Unable to create " + dir.getAbsolutePath()
                        + " for H2 database.");
            }
            this.jdbcString = "jdbc:h2:file:" + path + File.separator + "gwc_metastore"
                    + ";TRACE_LEVEL_FILE=0;AUTO_SERVER=TRUE";
        }

        try {
            Class.forName(driverClass);
        } catch (ClassNotFoundException cnfe) {
            throw new StorageException("Class not found: " + cnfe.getMessage());
        }

        if (!useConnectionPooling) {
            persistentConnection = getConnection();
        }
View Full Code Here

Examples of org.rundeck.storage.api.StorageException

        final testSSHExecInterface test = new testSSHExecInterface();

        state.sshConnectionInfo.authenticationType = SSHTaskBuilder.AuthenticationType.privateKey;
        state.sshConnectionInfo.privateKeyResourcePath = "/keys/key1.pem";
        state.sshConnectionInfo.privateKeyResourceData = new ByteArrayInputStream("data".getBytes());
        state.sshConnectionInfo.privateKeyResourceDataStorageException = new StorageException("blah",
                StorageException.Event.READ, PathUtil.asPath("keys/key1.pem"));
        state.sshConnectionInfo.username = "usernameValue";

        try {
            runBuildSSH(state, test, testLogger);
View Full Code Here

Examples of org.sonatype.nexus.proxy.StorageException

    final StorageItem item;
    try {
      item = metadataSource.doRetrieveItem(request, this);
    }
    catch (IOException e) {
      throw new StorageException(e);
    }
    if (item != null) {
      return item;
    }
View Full Code Here

Examples of org.syncany.plugins.transfer.StorageException

    if (isNextOperationSuccessful(operationType, operationDescription)) {
      super.connect();
    }
    else {
      throw new StorageException("Operation failed: " + operationDescription);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.