Package org.drools.repository

Examples of org.drools.repository.PackageItem.loadAsset()


                    if ( path[2].startsWith( "._" ) ) {
                        return this.osxDoubleData.containsKey( uri );
                    }
                    String assetName = AssetItem.getAssetNameFromFileName( path[2] )[0];

                    return pkg.containsAsset( assetName ) && !pkg.loadAsset( assetName ).isArchived();
                }
            } else if ( path[0].equals( "snapshots" ) ) {
                if ( path.length == 2 ) {
                    return repository.containsPackage( path[1] );
                } else if ( path.length == 3 ) {
View Full Code Here


                if ( path[2].startsWith( "._" ) ) {
                    osxDoubleData.remove( uri );
                    return;
                }
                String asset = AssetItem.getAssetNameFromFileName( path[2] )[0];
                AssetItem item = pkg.loadAsset( asset );
                item.archiveItem( true );
                item.checkin( "" );
            } else {
                //delete package
                pkg.archiveItem( true );
View Full Code Here

                }
                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())) {
            asset.checkin( "<content from webdav>" );
View Full Code Here

        } else {
            pkg = repository.loadPackageSnapshot( packageName,
                                                  packageVersion );
        }

        AssetItem item = pkg.loadAsset( assetName );
        ContentHandler handler = ContentManager.getHandler( item.getFormat() );//new AssetContentFormatHandler();
        StringBuffer buf = new StringBuffer();
        if ( handler.isRuleAsset() ) {

            BRMSPackageBuilder builder = new BRMSPackageBuilder();
View Full Code Here

                                        null );
                return;
            }
            if ( pkg.containsAsset( resource[0] ) ) {

                AssetItem lazarus = pkg.loadAsset( resource[0] );
                lazarus.archiveItem( false );
                //lazarus.checkin("<from webdav>");
            } else {
                AssetItem asset = pkg.addAsset( resource[0],
                                                "" );
View Full Code Here

                //dealing with package
                return pkg.getCreatedDate().getTime();
            } else {
                String fileName = path[2];
                String assetName = AssetItem.getAssetNameFromFileName( fileName )[0];
                AssetItem asset = pkg.loadAsset( assetName );
                return asset.getCreatedDate().getTime();
            }
        } else if ( path[0].equals( "snapshots" ) && checkPackagePermission( path[1],
                                                                             RoleTypes.PACKAGE_READONLY ) ) {
            if ( path.length == 2 ) {
View Full Code Here

                return repository.loadPackageSnapshot( path[1],
                                                       path[2] ).getCreatedDate().getTime();
            } else if ( path.length == 4 ) {
                PackageItem pkg = repository.loadPackageSnapshot( path[1],
                                                                  path[2] );
                AssetItem asset = pkg.loadAsset( AssetItem.getAssetNameFromFileName( path[3] )[0] );
                return asset.getCreatedDate().getTime();
            } else {
                throw new UnsupportedOperationException();
            }
        } else {
View Full Code Here

                //dealing with package
                return pkg.getLastModified().getTime();
            } else {
                String fileName = path[2];
                String assetName = AssetItem.getAssetNameFromFileName( fileName )[0];
                AssetItem asset = pkg.loadAsset( assetName );
                return asset.getLastModified().getTime();
            }
        } else if ( path[0].equals( "snapshots" ) && checkPackagePermission( path[1],
                                                                             RoleTypes.PACKAGE_READONLY ) ) {
            if ( path.length == 2 ) {
View Full Code Here

                return repository.loadPackageSnapshot( path[1],
                                                       path[2] ).getLastModified().getTime();
            } else if ( path.length == 4 ) {
                PackageItem pkg = repository.loadPackageSnapshot( path[1],
                                                                  path[2] );
                AssetItem asset = pkg.loadAsset( AssetItem.getAssetNameFromFileName( path[3] )[0] );
                return asset.getLastModified().getTime();
            } else {
                throw new UnsupportedOperationException();
            }
        } else {
View Full Code Here

            } else {
                String fileName = path[2];
                String assetName = AssetItem.getAssetNameFromFileName( fileName )[0];
                AssetItem asset;
                try {
                    asset = pkg.loadAsset( assetName );
                } catch ( Exception e ) {
                    return null;
                }
                return createStoredObject( uri,
                                           asset,
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.