Class StorageUtils
- java.lang.Object
-
- org.gcube.dataanalysis.executor.util.StorageUtils
-
public class StorageUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description StorageUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcalcFileRows(File file, boolean hasheader)static voiddownloadFilefromStorage(String scope, String user, String localFolder, String file)static voiddownloadInputFile(String fileurl, String destinationFile)static voiddownloadInputFile(String fileurl, String destinationFile, boolean httpURL)static voidFileSubset(File infile, File outfile, int index, int numberofelements, boolean hasheader)static voidinputStreamToFile(InputStream is, String path)static voidmain(String[] args)static voidmergeFiles(String localFolder, List<String> filenames, String outputfile, boolean hasheader)static StringuploadFilesOnStorage(String scope, String user, String localFolder, String file)static StringuploadFilesOnStorage(String scope, String user, String localFolder, String remoteFolder, String file, boolean httpslink)
-
-
-
Method Detail
-
downloadInputFile
public static void downloadInputFile(String fileurl, String destinationFile) throws Exception
- Throws:
Exception
-
downloadInputFile
public static void downloadInputFile(String fileurl, String destinationFile, boolean httpURL) throws Exception
- Throws:
Exception
-
inputStreamToFile
public static void inputStreamToFile(InputStream is, String path) throws FileNotFoundException, IOException
- Throws:
FileNotFoundExceptionIOException
-
uploadFilesOnStorage
public static String uploadFilesOnStorage(String scope, String user, String localFolder, String remoteFolder, String file, boolean httpslink) throws Exception
- Throws:
Exception
-
uploadFilesOnStorage
public static String uploadFilesOnStorage(String scope, String user, String localFolder, String file) throws Exception
- Throws:
Exception
-
calcFileRows
public static int calcFileRows(File file, boolean hasheader)
-
FileSubset
public static void FileSubset(File infile, File outfile, int index, int numberofelements, boolean hasheader) throws Exception
- Throws:
Exception
-
downloadFilefromStorage
public static void downloadFilefromStorage(String scope, String user, String localFolder, String file) throws Exception
- Throws:
Exception
-
mergeFiles
public static void mergeFiles(String localFolder, List<String> filenames, String outputfile, boolean hasheader) throws Exception
- Throws:
Exception
-
-