How to create and update assets via iRAM web-service interface not using iRAM API method ?
Please give any helper Link [OR] sample program about how to create and update assets via iRAM web-service interface not using iRAM API method ?
And one additional question if artifacts can be created in asset
(like RAMFolderArtifact, LocalFileArtifact, LocalFolderArtifact, LocalArchiveFolderArtifact and RAMURLArtifact can be added to the artifact root (or any other RAMFolder artifact) by using RAMFolderArtifact.addArtifact(Artifact) or RAMFolderArtifact.addArtifact(String path, Artifact in jav API).
Thank you
Bakiyaraj Arul
bakiyaraj.arul@in.ibm.com
iRAM Central Support Team
And one additional question if artifacts can be created in asset
(like RAMFolderArtifact, LocalFileArtifact, LocalFolderArtifact, LocalArchiveFolderArtifact and RAMURLArtifact can be added to the artifact root (or any other RAMFolder artifact) by using RAMFolderArtifact.addArtifact(Artifact) or RAMFolderArtifact.addArtifact(String path, Artifact in jav API).
Thank you
Bakiyaraj Arul
bakiyaraj.arul@in.ibm.com
iRAM Central Support Team
One answer
Webservices are internal APIs ...
The following is a sample Java Code:
The following is a sample Java Code:
public class UploadArtifacts {
private static void addFile(RAMFolderArtifact rroot, File f) {
LocalFileArtifact fileArtifact = new LocalFileArtifact(f);
System.out.println(new Date()+" - Adding: "+f.getName());
rroot.addArtifact(fileArtifact);
}
public static void main(String[] args) {
RAMSession session = new RAMSession("some url, "uid", "passwd");
session.setWebServiceTimeout(60000000);
// see http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m0/topic/com.ibm.ram.doc/topics/r_api_createmodifyordeleteassets.html
String GUID = "some guid";
String Version = "some version";
String SrcDir = "/fromdir";
int skip = 19;
RAMAsset asset = session.getAsset(new AssetIdentification(GUID, Version));
System.out.println("Processing: "+asset.getName()+" ["+asset.getIdentification().getVersion()+"]");
RAMFolderArtifact RamRoot = (RAMFolderArtifact)asset.getArtifactsRoot();
File FileRoot = new File (SrcDir);
if (FileRoot.isDirectory()) {
try {
File[] toUpload = FileRoot.listFiles();
for (int i = 0; i < toUpload.length; i++) {
if (i>=skip) {
addFile(RamRoot, toUpload[i]);
session.put(asset, new NullProgressMonitor());
}
}
}
catch (Throwable t) {
t.printStackTrace();
}
finally {
session.release();
}
}
else {
System.out.println("Source Directory is not a directory: "+SrcDir);
}
}