查看高速缓存的 URL 工件

Rational Asset Manager 可以维护 URL 工件的高速缓存副本。请使用 RAMURLArtifact.hasCachedContent() 方法来检查工件是否具有可下载的高速缓存版本。请使用 RAMURLArtifact.getCachedContent() 来获取对工件内容的高速缓存版本的输入流。

                //Get the artifact root
		FolderArtifact root = asset.getArtifactsRoot();
	  	Artifact[] children = root.getChildren();
	  	
	  	//Iterate through the artifacts in the root folder
	  	for(int i = 0; i < children.length; i++){
	  		//Check every URL artifact
													message.toString()));										
	  			RAMURLArtifact urlArtifact = ((RAMURLArtifact)children[i]);
	  			
	  			//Check if there is cached content for this URL
	  			if(urlArtifact.hasCachedContent()){
	   				//Get an input stream to the cached content of this URL
	  				InputStream is = urlArtifact.getCachedContent();
	  				
	  				//Read the URL's cached content
	  			}
	  		}
	  	}

反馈