added a wrapper

This commit is contained in:
Francesco Mangiacrapa 2019-10-01 18:16:48 +02:00
parent 992b1cd2b1
commit ac85f3dd92
2 changed files with 75 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target/

View File

@ -0,0 +1,74 @@
package org.gcube.datatransfer.resolver.storage;
import org.gcube.contentmanagement.blobstorage.resource.MyFile;
/**
* The Class StorageMetadataFile.
* Small java wrapper to {@link MyFile}} and its size
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Oct 1, 2019
*/
public class StorageMetadataFile {
private MyFile myFile;
private long size;
/**
* Instantiates a new storage metadata file.
*
* @param myFile the my file
* @param size the size
*/
public StorageMetadataFile(MyFile myFile, long size) {
this.myFile = myFile;
this.size = size;
}
/**
* Gets the my file.
*
* @return the my file
*/
public MyFile getMyFile() {
return myFile;
}
/**
* Gets the size.
*
* @return the size
*/
public long getSize() {
return size;
}
/**
* Gets the name.
*
* @return the name
*/
public String getName() {
if(myFile==null)
return null;
return myFile.getName();
}
/**
* Gets the mime type.
*
* @return the mime type
*/
public String getMimeType() {
if(myFile==null)
return null;
return myFile.getMimeType();
}
}