Search in sources :

Example 1 with ObjManagerUtil

use of com.pspace.ifs.ksan.objmanager.ObjManagerUtil in project ksan by infinistor.

the class GetAttr method getObjects.

void getObjects() {
    Metadata mt;
    try {
        ObjManagerUtil obmu = new ObjManagerUtil();
        if (!ObjectPath.isEmpty())
            mt = obmu.getObjectWithPath(bucketName, ObjectPath);
        else
            mt = obmu.getObject(bucketName, objId);
        displayMeta(mt);
    } catch (ResourceNotFoundException ex) {
        displayNothing();
    } catch (Exception ex) {
        Logger.getLogger(GetAttr.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : ObjManagerUtil(com.pspace.ifs.ksan.objmanager.ObjManagerUtil) Metadata(com.pspace.ifs.ksan.objmanager.Metadata) ResourceNotFoundException(com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceNotFoundException) CmdLineException(org.kohsuke.args4j.CmdLineException) ResourceNotFoundException(com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceNotFoundException)

Example 2 with ObjManagerUtil

use of com.pspace.ifs.ksan.objmanager.ObjManagerUtil in project ksan by infinistor.

the class GetObjectMetadata method getObjects.

private int getObjects() {
    Metadata mt1;
    try {
        ObjManagerUtil obmu = new ObjManagerUtil();
        mt1 = obmu.getObjectWithPath(mt.getBucket(), mt.getPath());
        message = mt1.toString();
        return 1;
    } catch (ResourceNotFoundException ex) {
        message = displayNoInformation();
        return 0;
    } catch (Exception ex) {
        message = dispalyError();
    }
    return -1;
}
Also used : ObjManagerUtil(com.pspace.ifs.ksan.objmanager.ObjManagerUtil) Metadata(com.pspace.ifs.ksan.objmanager.Metadata) ResourceNotFoundException(com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceNotFoundException) ResourceNotFoundException(com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceNotFoundException)

Aggregations

Metadata (com.pspace.ifs.ksan.objmanager.Metadata)2 ResourceNotFoundException (com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceNotFoundException)2 ObjManagerUtil (com.pspace.ifs.ksan.objmanager.ObjManagerUtil)2 CmdLineException (org.kohsuke.args4j.CmdLineException)1