removed commented exclude

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@174651 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-12-07 10:28:37 +00:00
parent 7cedebeba9
commit 8e49faeb2a
3 changed files with 28 additions and 22 deletions

View File

@ -9,10 +9,11 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
@ -53,7 +54,7 @@ public class AnalyticsCreateResolver {
/**
*
*
*/
private static final String DATAMINER_INVOCATION_MODEL = "dim";
/**
@ -63,6 +64,8 @@ public class AnalyticsCreateResolver {
private static Logger logger = LoggerFactory.getLogger(AnalyticsCreateResolver.class);
private static String helpURI = "https://wiki.gcube-system.org/gcube/URI_Resolver#Analitycs_Resolver";
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
/**
* Post catalogue.
*
@ -169,7 +172,8 @@ public class AnalyticsCreateResolver {
try {
ByteArrayOutputStream xmlByteArray = DataMinerInvocationManager.marshaling(dmInvocation, org.gcube.data.analysis.dminvocation.MediaType.ApplicationXML);
tempInvocationFile = createTempFile("dataminer-invocation"+UUID.randomUUID(), ".xml", xmlByteArray.toByteArray());
String uniqueName = createDMInvocationFileName(jsonRequest.getOperatorId());
tempInvocationFile = createTempFile(uniqueName, ".xml", xmlByteArray.toByteArray());
//CREATE THE FILE ON STORAGE HUB
@ -205,6 +209,7 @@ public class AnalyticsCreateResolver {
}
/**
* Creates the temp file.
*
@ -224,4 +229,22 @@ public class AnalyticsCreateResolver {
return file;
}
/**
* Creates the dm invocation file name.
*
* @param operatorId the operator id
* @return the string
*/
private static String createDMInvocationFileName(String operatorId){
String fileName = "dim";
int index = operatorId.lastIndexOf(".");
if(index>0 && index<operatorId.length()){
fileName+="-"+operatorId.substring(index+1,operatorId.length());
}
String currentTimestamp = dateFormat.format(new Date());
fileName+="-"+currentTimestamp;
return fileName;
}
}

View File

@ -3,22 +3,6 @@
<group>DataTransfer</group>
<version>1.0.0-SNAPSHOT</version>
<description>URIResolver RESTful</description>
<include>/analytics/create</include>
<include>/knime/create</include>
<!-- <exclude handlers='request-validation context-retriever'>/smp</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/id</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/gis</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/storage*</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/ctlg*</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/catalogue</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/geonetwork*</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/shub*</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/parthenos_registry</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/analytics/get</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/knime/get</exclude> -->
<!-- <exclude handlers='request-validation context-retriever'>/*</exclude> -->
</application>

View File

@ -19,7 +19,6 @@ import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpStatus;
import org.gcube.datatransfer.resolver.util.HTTPCallsUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -86,7 +85,7 @@ public class TestResolvers {
*
* @throws Exception the exception
*/
@Test
//@Test
public void testStorageID() throws Exception{
String storageID = "clZ2YmxTYytETzVLaHkwMjM3TmVETTFMb256YVRMS3lHbWJQNStIS0N6Yz0";
@ -130,7 +129,7 @@ public class TestResolvers {
*
* @throws Exception the exception
*/
@Test
//@Test
public void testStorageIDdoHEAD() throws Exception{
String storageID = "clZ2YmxTYytETzVLaHkwMjM3TmVETTFMb256YVRMS3lHbWJQNStIS0N6Yz0";