use of com.google.cloud.bigquery.connection.v1.Connection in project COSMIC-CryoEM-Gateway by cianfrocco-lab.
the class SFTPFileHandler method moveFile.
public void moveFile(String fileName, String newFileName) throws IOException {
Connection conn = getConnection();
SFTPv3Client client = null;
try {
client = new SFTPv3Client(conn);
m_log.debug("Moving " + fileName + " to " + newFileName + " via " + m_host);
client.mv(fileName, newFileName);
} catch (SFTPException sftpErr) {
m_log.debug(sftpErr.getServerErrorMessage() + ": " + sftpErr.getServerErrorCodeVerbose());
throw sftpErr;
} finally {
if (client != null)
client.close();
conn.close();
}
}
use of com.google.cloud.bigquery.connection.v1.Connection in project COSMIC-CryoEM-Gateway by cianfrocco-lab.
the class SFTPFileHandler method writeFile.
public void writeFile(String fileName, InputStream inStream) throws IOException {
Connection conn = getConnection();
SFTPv3Client client = null;
try {
client = new SFTPv3Client(conn);
writeFile(client, fileName, inStream);
} finally {
if (client != null)
client.close();
conn.close();
}
}
use of com.google.cloud.bigquery.connection.v1.Connection in project COSMIC-CryoEM-Gateway by cianfrocco-lab.
the class SFTPFileHandler method getAttributes.
private SFTPv3FileAttributes getAttributes(String fileName) throws IOException {
Connection conn = getConnection();
SFTPv3Client client = null;
try {
client = new SFTPv3Client(conn);
return client.stat(fileName);
} finally {
if (client != null)
client.close();
conn.close();
}
}
use of com.google.cloud.bigquery.connection.v1.Connection in project COSMIC-CryoEM-Gateway by cianfrocco-lab.
the class SFTPFileHandler method removeFile.
public void removeFile(String fileName) throws IOException {
Connection conn = getConnection();
SFTPv3Client client = null;
try {
client = new SFTPv3Client(conn);
client.rm(fileName);
m_log.debug("Removed " + fileName);
} finally {
if (client != null)
client.close();
conn.close();
}
}
use of com.google.cloud.bigquery.connection.v1.Connection in project pinpoint by naver.
the class MethodInvocationHandlerInterceptor method createTrace.
/**
* Creates the trace.
*
* @param target the target
* @param args the args
* @return the trace
*/
private Trace createTrace(final Object target, final Object[] args) {
final Trace trace = traceContext.newTraceObject();
final Connection connection = RemotingContext.getConnection();
final String remoteAddress = JbossUtility.fetchRemoteAddress(connection);
if (trace.canSampled()) {
final SpanRecorder recorder = trace.getSpanRecorder();
final String methodName = getMethodName(args);
recordRootSpan(recorder, methodName, remoteAddress);
if (isDebug) {
logger.debug("Trace sampling is true, Recording trace. methodInvoked:{}, remoteAddress:{}", methodName, remoteAddress);
}
} else {
if (isDebug) {
final String methodName = getMethodName(args);
logger.debug("Trace sampling is false, Skip recording trace. methodInvoked:{}, remoteAddress:{}", methodName, remoteAddress);
}
}
return trace;
}
Aggregations