All pastes #395099 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-14 20:09 UTC
rendered paste body
        // Acquire handles to managers
        AssetManager assetManager = Connector.getAssetManager();
        Cataloger cataloger = Connector.getCataloger();
        
        // Initialize parameters for EMS calls
        Map options = new HashMap();
        Map metadata = new HashMap();
        Collection metadataTemplateList = new ArrayList();
        String assetVersionUuid = "";
        
        // Create some asset placeholders
        assetVersionUuid = assetManager.createAsset(m_userAuth,
                                                    AssetType.IMAGE,
                                                    "Yahoo Logo",
                                                    "Created for JUnit catalogFile test.",
                                                    m_userAuth.getOrgUuid(),
                                                    metadataTemplateList,
                                                    metadata);
        cleanupAssetUuids.add(assetVersionUuid);
        
        // Catalog some files and associate them with the placeholder assets
        URI uri = new URI("http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif");
        options.put(CatalogingOption.ASSET_VERSION_UUID, assetVersionUuid);
        assetVersionUuid = cataloger.catalogFileAtURI(m_userAuth, uri, options, metadata);
        
        cleanupAssetUuids.add(assetVersionUuid);