Package org.drools.repository

Examples of org.drools.repository.RulesRepository.loadPackage()


        RulesRepository repository = getRepo();
        String[] path = getPath( uri );
        if ( path.length < 2 ) return new Date();
        if ( path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                     RoleTypes.PACKAGE_READONLY ) ) {
            PackageItem pkg = repository.loadPackage( path[1] );
            if ( path.length == 2 ) {
                //dealing with package
                return pkg.getCreatedDate().getTime();
            } else {
                String fileName = path[2];
View Full Code Here


        RulesRepository repository = getRepo();
        String[] path = getPath( uri );
        if ( path.length < 2 ) return new Date();
        if ( path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                     RoleTypes.PACKAGE_READONLY ) ) {
            PackageItem pkg = repository.loadPackage( path[1] );
            if ( path.length == 2 ) {
                //dealing with package
                return pkg.getLastModified().getTime();
            } else {
                String fileName = path[2];
View Full Code Here

            return so;
        }
        if ( path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                     RoleTypes.PACKAGE_READONLY ) ) {
            PackageItem pkg = repository.loadPackage( path[1] );
            if ( path.length == 2 ) {
                //dealing with package
                return createStoredObject( uri,
                                           pkg,
                                           0 );
View Full Code Here

        String[] path = getPath( uri );
        if ( path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                     RoleTypes.PACKAGE_READONLY ) ) {
            String pkg = path[1];
            String asset = AssetItem.getAssetNameFromFileName( path[2] )[0];
            AssetItem assetItem = repository.loadPackage( pkg ).loadAsset( asset );
            return getAssetData( assetItem );
        } else if ( path[0].equals( "snapshots" ) && checkPackagePermission( path[1],
                                                                             RoleTypes.PACKAGE_READONLY ) ) {
            String pkg = path[1];
            String snap = path[2];
View Full Code Here

        String[] path = getPath( uri );
        try {
            RulesRepository repo = getRepo();
            if ( path.length == 3 && path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                                             RoleTypes.PACKAGE_READONLY ) ) {
                PackageItem pkg = repo.loadPackage( path[1] );
                AssetItem asset = pkg.loadAsset( AssetItem.getAssetNameFromFileName( path[2] )[0] );
                return asset.getContentLength();
            } else if ( path.length == 4 && path[0].equals( "snapshots" ) && checkPackagePermission( path[1],
                                                                                                     RoleTypes.PACKAGE_READONLY ) ) {
                PackageItem pkg = repo.loadPackageSnapshot( path[1],
View Full Code Here

        String[] path = getPath( uri );
        if ( path.length < 3 ) return false;
        if ( !(path[0].equals( "packages" ) || path[0].equals( "snapshots" )) ) return false;
        if ( repository.containsPackage( path[1] ) ) {
            if ( path[0].equals( "packages" ) ) {
                PackageItem pkg = repository.loadPackage( path[1] );
                if ( path[2].startsWith( "._" ) ) {
                    return osxDoubleData.containsKey( uri );
                }
                return pkg.containsAsset( AssetItem.getAssetNameFromFileName( path[2] )[0] );
            } else {
View Full Code Here

                return false;
            }

            if ( path[0].equals( "packages" ) ) {
                if ( path.length == 2 ) {
                    PackageItem pkg = repository.loadPackage( path[1] );
                    return !pkg.isArchived();
                } else {
                    PackageItem pkg = repository.loadPackage( path[1] );
                    if ( path[2].startsWith( "._" ) ) {
                        return this.osxDoubleData.containsKey( uri );
View Full Code Here

            if ( path[0].equals( "packages" ) ) {
                if ( path.length == 2 ) {
                    PackageItem pkg = repository.loadPackage( path[1] );
                    return !pkg.isArchived();
                } else {
                    PackageItem pkg = repository.loadPackage( path[1] );
                    if ( path[2].startsWith( "._" ) ) {
                        return this.osxDoubleData.containsKey( uri );
                    }
                    String assetName = AssetItem.getAssetNameFromFileName( path[2] )[0];
View Full Code Here

            throw new IllegalArgumentException();
        }
        if ( path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                     RoleTypes.PACKAGE_DEVELOPER ) ) {
            String packName = path[1];
            PackageItem pkg = repository.loadPackage( packName );
            if ( path.length == 3 ) {
                //delete asset
                if ( path[2].startsWith( "._" ) ) {
                    osxDoubleData.remove( uri );
                    return;
View Full Code Here

                    throw new RuntimeException( e );
                }
                return 0;
            }
            String[] assetName = AssetItem.getAssetNameFromFileName( path[2] );
            PackageItem pkg = repository.loadPackage( packageName );
            AssetItem asset = pkg.loadAsset( assetName[0] );
            asset.updateBinaryContentAttachment( content );
            //here we could save, or check in, depending on if enough time has passed to justify
            //a new version. Otherwise we will pollute the version history with lots of trivial versions.
            //if (shouldCreateNewVersion(asset.getLastModified())) {
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.