use of com.pspace.ifs.ksan.gw.exception.GWException in project ksan by infinistor.
the class S3Request method listObject.
protected ObjectListParameter listObject(String bucket, S3ObjectList s3ObjectList) throws GWException {
ObjectListParameter objectListParameter = null;
try {
setObjManager();
objectListParameter = objManager.listObject(bucket, s3ObjectList);
} catch (Exception e) {
PrintStack.logging(logger, e);
throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
} finally {
try {
releaseObjManager();
} catch (Exception e) {
PrintStack.logging(logger, e);
throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
}
}
return objectListParameter;
}
use of com.pspace.ifs.ksan.gw.exception.GWException in project ksan by infinistor.
the class S3Request method create.
protected Metadata create(String bucket, String object) throws GWException {
Metadata meta = null;
try {
setObjManager();
meta = objManager.create(bucket, object);
} catch (Exception e) {
PrintStack.logging(logger, e);
throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
} finally {
try {
releaseObjManager();
} catch (Exception e) {
PrintStack.logging(logger, e);
throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
}
}
return meta;
}
use of com.pspace.ifs.ksan.gw.exception.GWException in project ksan by infinistor.
the class S3Request method isExistBucket.
protected boolean isExistBucket(String bucket) throws GWException {
boolean result = false;
try {
setObjManager();
result = objManager.isBucketExist(bucket);
} catch (Exception e) {
PrintStack.logging(logger, e);
throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
} finally {
try {
releaseObjManager();
} catch (Exception e) {
PrintStack.logging(logger, e);
throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
}
}
return result;
}
use of com.pspace.ifs.ksan.gw.exception.GWException in project ksan by infinistor.
the class S3Request method createLocal.
protected Metadata createLocal(String bucket, String object) throws GWException {
Metadata meta = null;
try {
setObjManager();
meta = objManager.createLocal(bucket, object);
} catch (Exception e) {
PrintStack.logging(logger, e);
throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
} finally {
try {
releaseObjManager();
} catch (Exception e) {
PrintStack.logging(logger, e);
throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
}
}
return meta;
}
use of com.pspace.ifs.ksan.gw.exception.GWException in project ksan by infinistor.
the class S3DataRequest method readXml.
protected String readXml() throws GWException {
String ret = null;
try {
byte[] xml = s3Parameter.getInputStream().readAllBytes();
s3Parameter.addRequestSize(xml.length);
ret = new String(xml);
} catch (IOException e) {
PrintStack.logging(logger, e);
throw new GWException(GWErrorCode.INTERNAL_SERVER_ERROR, s3Parameter);
}
logger.info(ret);
if (Strings.isNullOrEmpty(ret)) {
logger.warn(GWErrorCode.INVALID_ARGUMENT.getMessage());
throw new GWException(GWErrorCode.INVALID_ARGUMENT, s3Parameter);
}
if (!ret.contains(GWConstants.XML_VERSION)) {
ret = GWConstants.XML_VERSION_FULL_STANDALONE + ret;
}
return ret;
}
Aggregations