|
|
|
@ -2,12 +2,10 @@ package org.gcube.data.transfer.plugins.sis;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.FileNotFoundException;
|
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
|
import java.net.MalformedURLException;
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
import java.nio.file.StandardCopyOption;
|
|
|
|
|
import java.security.MessageDigest;
|
|
|
|
@ -15,7 +13,6 @@ import java.security.NoSuchAlgorithmException;
|
|
|
|
|
|
|
|
|
|
import org.apache.sis.storage.DataStoreException;
|
|
|
|
|
import org.apache.sis.storage.UnsupportedStorageException;
|
|
|
|
|
import org.gcube.data.transfer.model.TransferTicket.Status;
|
|
|
|
|
import org.gcube.data.transfer.plugins.thredds.sis.SisPlugin;
|
|
|
|
|
|
|
|
|
|
public class TestGetMetadata {
|
|
|
|
@ -28,11 +25,35 @@ public class TestGetMetadata {
|
|
|
|
|
|
|
|
|
|
for(String f:toCheckFiles) {
|
|
|
|
|
System.out.println("checking "+f);
|
|
|
|
|
check(false,f);
|
|
|
|
|
try{
|
|
|
|
|
check(false,f);
|
|
|
|
|
}catch(UnsupportedStorageException e) {
|
|
|
|
|
System.err.println(e.getMessage());
|
|
|
|
|
// System.out.println("Trying opening "+f+" manually");
|
|
|
|
|
// open(f);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
System.out.println("Done");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// private static void open(String path) throws IOException, UnsupportedStorageException, DataStoreException {
|
|
|
|
|
// System.out.println("Opening "+path);
|
|
|
|
|
// NetcdfFile f=NetcdfFiles.open(path);
|
|
|
|
|
// System.out.println(f.getFileTypeDescription()+"\t"+f.getFileTypeId());
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// NetcdfDataset ncDs=NetcdfDatasets.openDataset(path);
|
|
|
|
|
//// NcMLReaderNew.
|
|
|
|
|
////
|
|
|
|
|
// System.out.println(ncDs.getFileTypeDescription()+"\t"+ncDs.getFileTypeId());
|
|
|
|
|
//
|
|
|
|
|
//// NetcdfDatasets.openFile(path,null);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void check(boolean checkCopy,String src) throws UnsupportedStorageException, DataStoreException, IOException, NoSuchAlgorithmException {
|
|
|
|
|
|
|
|
|
|
File original=new File(src);
|
|
|
|
|