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>
|
||||
<groupId>org.gcube.data.transfer</groupId>
|
||||
<artifactId>data-transfer-service</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>DataTransferService</name>
|
||||
<scm>
|
||||
|
@ -49,7 +49,11 @@
|
|||
<artifactId>decompress-archive-plugin</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.data.transfer</groupId>
|
||||
<artifactId>sis-geotk-plugin</artifactId>
|
||||
<version>LATEST</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -87,7 +87,8 @@ public abstract class AbstractTicketHandler {
|
|||
BufferedOutputStream out=null;
|
||||
Boolean completedTransfer=false;
|
||||
File destination=null;
|
||||
|
||||
File tempFile=null;
|
||||
|
||||
try{
|
||||
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());
|
||||
|
@ -110,10 +111,10 @@ public abstract class AbstractTicketHandler {
|
|||
|
||||
|
||||
is=getInputStream();
|
||||
|
||||
tempFile=File.createTempFile("transfer_"+ticket.getId(), ".tmp");
|
||||
|
||||
try{
|
||||
out=new BufferedOutputStream(new FileOutputStream(destination));
|
||||
out=new BufferedOutputStream(new FileOutputStream(tempFile));
|
||||
} catch (IOException e) {
|
||||
log.warn("Unable to create destination file.",e);
|
||||
throw new ManagedException("Cannot save file in host");
|
||||
|
@ -123,7 +124,8 @@ public abstract class AbstractTicketHandler {
|
|||
completedTransfer=true;
|
||||
// IF TRANSFER FAILS, EXCEPTIONS AR THROWN
|
||||
|
||||
|
||||
log.debug("Completed transfer to {} , moving to destination {} ",tempFile.getAbsolutePath(),destination.getAbsolutePath());
|
||||
tempFile.renameTo(destination);
|
||||
|
||||
//Plugin execution
|
||||
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);
|
||||
|
||||
}catch(PluginNotFoundException e){
|
||||
|
|
Loading…
Reference in New Issue