//irodsBuilder.setAccount(irodsAccount, irodsOpts);
//IRODSVfsFileSystem vfsFileSystem = (IRODSVfsFileSystem) VFS.getManager().resolveFile(getURIString(irodsAccount), irodsOpts).getFileSystem();
//IRODSFileSystem irodsFs = (IRODSFileSystem) vfsFileSystem.getAttribute(IRODSVfsFileSystem.FILESYSTEM);
try
{
IRODSFileSystem irodsFS = new IRODSFileSystem(irodsAccount);
System.out.println("after constructor - about to query with GSI");
MetaDataRecordList[] recordList = null;
try
{
recordList = irodsFS
.query(
new MetaDataCondition[] {
MetaDataSet
.newCondition(
IRODSMetaDataSet.USER_DN,
MetaDataCondition.EQUAL,
"/C=AU/O=APACGrid/OU=TPAC/CN=Pauline Mak")
},
new MetaDataSelect[] { MetaDataSet
.newSelection(IRODSMetaDataSet.USER_NAME) });
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
if(recordList == null)
{
System.out.println("getiRODSUsernameByDN: no result");
}
else
{
System.out.println("getiRODSUsernameByDN: " + recordList.length);
}
if(recordList != null&&recordList.length>0)
{
System.out.println("result: " + (String)recordList[0].getValue(IRODSMetaDataSet.USER_NAME));
}
System.out.println("account 1 info: " + irodsAccount.getUserName());
IRODSAccount irodsAccount2 = new IRODSAccount("srbdev.vpac.org", 1247,
"paulinemak1", "", "/srbdev.vpac.org/home/paulinemak1",
"srbdev.vpac.org", "datafabric.srbdev.vpac.org");
irodsAccount2.setGSSCredential(cert);
System.out.println("acount 2");
FileSystemOptions irodsOpts = new FileSystemOptions();
IRODSFileSystemConfigBuilder irodsBuilder = IRODSFileSystemConfigBuilder.getInstance();
irodsBuilder.setAccount(irodsAccount2, irodsOpts);
System.out.println("Account 2 URI: " + getURIString(irodsAccount2) + " " + irodsAccount2.getUserName());
IRODSFileSystem irodsFS2 = (IRODSFileSystem)(VFS.getManager().
resolveFile(getURIString(irodsAccount2), irodsOpts)
.getFileSystem().getAttribute(IRODSVfsFileSystem.FILESYSTEM));
System.out.println("resolved FS " + irodsFS2);