git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/branches/data-transfer/data-transfer-service/2.0@157398 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0de7540c8c
commit
d3c941ba65
8
pom.xml
8
pom.xml
|
@ -8,7 +8,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>org.gcube.data.transfer</groupId>
|
<groupId>org.gcube.data.transfer</groupId>
|
||||||
<artifactId>data-transfer-service</artifactId>
|
<artifactId>data-transfer-service</artifactId>
|
||||||
<version>2.0.0-SNAPSHOT</version>
|
<version>2.0.1-SNAPSHOT</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<name>DataTransferService</name>
|
<name>DataTransferService</name>
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -49,7 +49,11 @@
|
||||||
<artifactId>decompress-archive-plugin</artifactId>
|
<artifactId>decompress-archive-plugin</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.data.transfer</groupId>
|
||||||
|
<artifactId>sis-geotk-plugin</artifactId>
|
||||||
|
<version>LATEST</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -87,7 +87,8 @@ public abstract class AbstractTicketHandler {
|
||||||
BufferedOutputStream out=null;
|
BufferedOutputStream out=null;
|
||||||
Boolean completedTransfer=false;
|
Boolean completedTransfer=false;
|
||||||
File destination=null;
|
File destination=null;
|
||||||
|
File tempFile=null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
if(ticket.getSettings().getOptions().getMethod().equals(TransferMethod.DirectTransfer))
|
if(ticket.getSettings().getOptions().getMethod().equals(TransferMethod.DirectTransfer))
|
||||||
throw new NotSupportedMethodException("Unable to manage request [ID "+ticket.getId()+"]. Method not supported : "+ticket.getSettings().getOptions().getMethod());
|
throw new NotSupportedMethodException("Unable to manage request [ID "+ticket.getId()+"]. Method not supported : "+ticket.getSettings().getOptions().getMethod());
|
||||||
|
@ -110,10 +111,10 @@ public abstract class AbstractTicketHandler {
|
||||||
|
|
||||||
|
|
||||||
is=getInputStream();
|
is=getInputStream();
|
||||||
|
tempFile=File.createTempFile("transfer_"+ticket.getId(), ".tmp");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
out=new BufferedOutputStream(new FileOutputStream(destination));
|
out=new BufferedOutputStream(new FileOutputStream(tempFile));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.warn("Unable to create destination file.",e);
|
log.warn("Unable to create destination file.",e);
|
||||||
throw new ManagedException("Cannot save file in host");
|
throw new ManagedException("Cannot save file in host");
|
||||||
|
@ -123,7 +124,8 @@ public abstract class AbstractTicketHandler {
|
||||||
completedTransfer=true;
|
completedTransfer=true;
|
||||||
// IF TRANSFER FAILS, EXCEPTIONS AR THROWN
|
// IF TRANSFER FAILS, EXCEPTIONS AR THROWN
|
||||||
|
|
||||||
|
log.debug("Completed transfer to {} , moving to destination {} ",tempFile.getAbsolutePath(),destination.getAbsolutePath());
|
||||||
|
tempFile.renameTo(destination);
|
||||||
|
|
||||||
//Plugin execution
|
//Plugin execution
|
||||||
if(ticket.getPluginInvocations()!=null){
|
if(ticket.getPluginInvocations()!=null){
|
||||||
|
@ -146,7 +148,8 @@ public abstract class AbstractTicketHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug("Completed Transfer for ticket ID {} ",ticket.getId());
|
|
||||||
|
log.info("Completed Transfer for ticket ID {} ",ticket.getId());
|
||||||
onStep("Completed transfer",1d,Status.SUCCESS);
|
onStep("Completed transfer",1d,Status.SUCCESS);
|
||||||
|
|
||||||
}catch(PluginNotFoundException e){
|
}catch(PluginNotFoundException e){
|
||||||
|
|
Loading…
Reference in New Issue