Examples of RulesRepository


Examples of org.drools.repository.RulesRepository

        return so;
    }

    private InputStream getContent(String uri) {
        RulesRepository repository = getRepo();
        String[] path = getPath(uri);
        if (isPackages(path) && checkPackagePermissionIfReadOnly(path)) {
            return getAssetData(loadAssetItemFromPackage(repository,
                    path));
        }
View Full Code Here

Examples of org.drools.repository.RulesRepository

    public long getResourceLength(ITransaction iTransaction,
                                  String uri) {
        String[] path = getPath(uri);
        try {
            RulesRepository repository = getRepo();
            if (path.length == 3 && isPackages(path) && checkPackagePermissionIfReadOnly(path)) {
                return loadAssetItemFromPackage(repository,
                        path).getContentLength();
            }
View Full Code Here

Examples of org.drools.repository.RulesRepository

        }

    }

    boolean isFolder(String uri) {
        RulesRepository repository = getRepo();
        String[] path = getPath(uri);
        if (path.length == 0) {
            return true;
        }
        if (path.length == 1 && (isPackages(path) || isSnaphosts(path) || isGlobalAreas(path))) {
            return true;
        }

        if (path.length == 2) {
            return repository.containsPackage(path[1]);
        }

        if (path.length == 3 && isSnaphosts(path)) {
            return repository.containsPackage(path[1]);
        }
        return false;
    }
View Full Code Here

Examples of org.drools.repository.RulesRepository

        }
        return false;
    }

    boolean isResource(String uri) {
        RulesRepository repository = getRepo();
        String[] path = getPath(uri);

        if (path.length < 3) {
            return false;
        }
        if (!(isPackages(path) || isSnaphosts(path) || isGlobalAreas(path))) {
            return false;
        }

        if (repository.containsPackage(path[1])) {
            if (isPackages(path)) {
                PackageItem pkg = loadPackageFromRepository(repository,
                        path[1]);
                if (path[2].startsWith("._")) {
                    return osxDoubleData.containsKey(uri);
View Full Code Here

Examples of org.drools.repository.RulesRepository

        }
        return internalObjectExists(uri);
    }

    private boolean internalObjectExists(String uri) {
        RulesRepository repository = getRepo();
        if (uri.endsWith(".DS_Store")) {
            return false;
        }
        String[] path = getPath(uri);

        if (path.length == 0 || (path.length == 1 && (isPackages(path) || isSnaphosts(path) || isGlobalAreas(path)))) {
            return true;
        }

        if (path.length == 1 || !repository.containsPackage(path[1])) {
            return false;
        }

        if (isPackages(path)) {
            return handlePackagesInternalObjectExists(uri,
View Full Code Here

Examples of org.drools.repository.RulesRepository

        return pkg.containsAsset(assetName) && !pkg.loadAsset(assetName).isArchived();
    }

    public void removeObject(ITransaction iTransaction,
                             String uri) {
        RulesRepository repository = getRepo();
        String[] path = getPath(uri);
        if (path.length == 0 || path.length == 1) {
            throw new IllegalArgumentException();
        }
        if (isPackages(path) && checkPackagePermissionIfDeveloper(path)) {
View Full Code Here

Examples of org.drools.repository.RulesRepository

        }

    }

    public void rollback(ITransaction iTransaction) {
        RulesRepository repository = getRepo();
        repository.getSession().logout();
    }
View Full Code Here

Examples of org.drools.repository.RulesRepository

    public long setResourceContent(ITransaction iTransaction,
                                   String uri,
                                   InputStream content,
                                   String contentType,
                                   String characterEncoding) {
        RulesRepository repository = getRepo();
        if (uri.endsWith(".DS_Store")) {
            return 0;
        }
        String[] path = getPath(uri);
        if (isPackages(path) && checkPackagePermissionIfDeveloper(path)) {
View Full Code Here

Examples of org.drools.repository.RulesRepository

    @Override
    protected void doPost(final HttpServletRequest req,
                          final HttpServletResponse res) throws ServletException,
                                                        IOException {
        final RulesRepository repository = RestAPIServlet.getRepository();
        final RepositoryPackageService service = RepositoryServiceServlet.getPackageService();

        doAuthorizedAction( req,
                            res,
                            new Command() {
View Full Code Here

Examples of org.drools.repository.RulesRepository

        String[] path = getPath(uri);
        if (isPackages(path) && isAdmin()) {
            if (path.length > 2) {
                throw new UnsupportedOperationException("Can't nest packages.");
            }
            RulesRepository repository = getRepo();
            if (repository.containsPackage(path[1])) {
                PackageItem pkg = loadPackageFromRepository(repository,
                        path[1]);
                pkg.archiveItem(false);
                pkg.checkin("<restored by webdav>");
            } else {
                repository.createPackage(path[1],
                        "<from webdav>");
            }
        } else {
            throw new UnsupportedOperationException("Not able to create folders here...");
        }
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.