Package org.glite.authz.pap.repository.exceptions

Examples of org.glite.authz.pap.repository.exceptions.RepositoryException


            if (papCache.size() == 0) {
                cache.remove(papId);
            }

            if (!policyFile.delete()) {
                throw new RepositoryException("Cannot delete file: " + policyFile.getAbsolutePath());
            }

        } else {
            throw new NotFoundException(policyNotFoundExceptionMsg(policyId));
        }
View Full Code Here


                if (policy == null) {
                    try {
                        policy = new PolicyTypeString(policyId, policyHelper.readFromFileAsString(file));
                    } catch (Throwable e) {
                        throw new RepositoryException(e);
                    }
                    papCache.put(policyId, policy);
                }
                policyList.add(new PolicyTypeString(policyId, policy.getPolicyString()));
View Full Code Here

            }

            try {
                policy = new PolicyTypeString(policyId, policyHelper.readFromFileAsString(policyFile));
            } catch (Throwable e) {
                throw new RepositoryException(e);
            }

            papCache.put(policyId, policy);
        }
View Full Code Here

        if (oldPolicy == null) {
            try {
                oldPolicy = new PolicyTypeString(policyHelper.buildFromFile(policyFile));
            } catch (Throwable e) {
                throw new RepositoryException(e);
            }
        }

        if (!(oldPolicy.getVersion().equals(version))) {
            throw new InvalidVersionException(String.format("Attempting to update the wrong version of PolicyId=\"%s\" (requestedVersion=\"%s\", repositoryVersion=\"%s\")",
View Full Code Here

     * @param newDefaultPap
     */
    private void updateDefaultPap(Pap newDefaultPap) {

        if (!Pap.DEFAULT_PAP_ALIAS.equals(newDefaultPap.getAlias())) {
            throw new RepositoryException("Invalid alias for default pap. Cannot perform updateDefaultPap request.");
        }

        Pap oldDefaultPap = getPap(Pap.DEFAULT_PAP_ALIAS);

        newDefaultPap.setId(oldDefaultPap.getId());
View Full Code Here

                iniConfiguration.clearProperty(VERSION_KEY);
            }

            iniConfiguration.load();
        } catch (ConfigurationException e) {
            throw new RepositoryException("Configuration error", e);
        }

    }
View Full Code Here

            throw new AlreadyExistsException(String.format("Already exists: papAlias=%s", papAlias));
        }

        File directory = new File(getPapDirAbsolutePath(pap.getId()));
        if (!directory.mkdir())
            throw new RepositoryException(String.format("Cannot create directory for PAP: %s (id=%s) (dir=%s)",
                                                        papAlias,
                                                        pap.getId(),
                                                        directory));
        saveToINIConfiguration(pap);
    }
View Full Code Here

        clearPapProperties(papAlias);

        try {
            iniConfiguration.save();
        } catch (ConfigurationException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

    }

    private void saveToINIConfiguration(Pap pap) throws RepositoryException {

        if (pap == null) {
            throw new RepositoryException("BUG: PAP is null");
        }

        clearPapProperties(pap.getAlias());
        setPapProperties(pap);

        try {
            iniConfiguration.save();
        } catch (ConfigurationException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

            if (!dir.mkdirs()) // Find out what went wrong...
                setupRepositoryDirectory(dir.getParentFile());
        }

        if (!dir.canRead())
            throw new RepositoryException("Read permission not set: " + dir.getAbsolutePath());

        if (!dir.canWrite())
            throw new RepositoryException("Write permission not set: " + dir.getAbsolutePath());

        // Workaround for the canExecute method which does not exist in Java 5
        try {
            File tempFile = new File(dir.getAbsoluteFile() + File.separator + "delete_me.tmp");
            tempFile.createNewFile();
            tempFile.delete();
        } catch (IOException e) {
            throw new RepositoryException("Execute permission not set: " + dir.getAbsolutePath(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.glite.authz.pap.repository.exceptions.RepositoryException

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.