Skip to content
Snippets Groups Projects
Commit 40dd5f4a authored by Sara Bertocco's avatar Sara Bertocco
Browse files

New working version after Victoria trip - new version more generic

parent a0a8ae7b
No related branches found
No related tags found
No related merge requests found
/**_____________________________________________________________________________ /**
* _____________________________________________________________________________
* *
* OATS - INAF * OATS - INAF
* Osservatorio Astronomico di Tireste - Istituto Nazionale di Astrofisica * Osservatorio Astronomico di Tireste - Istituto Nazionale di Astrofisica
...@@ -21,60 +22,116 @@ ...@@ -21,60 +22,116 @@
* along with this program; if not, write to the Free Software Foundation, Inc., * along with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* _____________________________________________________________________________ * _____________________________________________________________________________
**/ *
*/
package it.inaf.oats.vospacebackend.implementation; package it.inaf.oats.vospacebackend.implementation;
import java.util.HashMap; import java.util.HashMap;
public class FileRecord { public class FileRecord {
private static final String stored_file_name = "stored_file_name"; //private static final String stored_file_name = "stored_file_name";
private static final String md5_checksum = "md5_checksum"; //private static final String md5_checksum = "md5_checksum";
private static final String relative_path = "relative_path"; //private static final String relative_path = "relative_path";
private static final String nodeID = "nodeID"; //private static final String nodeID = "nodeID";
//private static final String operationSuccessful = "ifSuccessful";
private HashMap content = new HashMap<String, String>(); private String stored_file_name_value;
private String md5_checksum_value;
private String relative_path_value;
private String nodeID_value;
private boolean operationSuccessful_value;
public FileRecord() { public FileRecord() {
content.put(stored_file_name, ""); stored_file_name_value = "";
content.put(md5_checksum, ""); md5_checksum_value = "";
content.put(relative_path, ""); relative_path_value = "";
content.put(nodeID, ""); nodeID_value = "";
operationSuccessful_value = false;
}
public void setFileRecord(String stored_f_name, String md5Checksum,
String relativePath, String nodeId, boolean ifSuccessful) {
this.stored_file_name_value = stored_f_name;
this.md5_checksum_value = md5Checksum;
this.relative_path_value = relativePath;
this.nodeID_value = nodeId;
this.operationSuccessful_value = ifSuccessful;
}
public void setStoredfileName(String storedfName) {
this.stored_file_name_value = storedfName;
}
public String getStoredfileName() {
return this.stored_file_name_value;
}
public void setMD5Checksum(String md5checksum) {
this.md5_checksum_value = md5checksum;
} }
public FileRecord(String stored_f_name, String md5Checksum, String relativePath) { public String getMD5Checksum() {
content.put(stored_file_name, stored_f_name); return this.md5_checksum_value;
content.put(md5_checksum, md5Checksum);
content.put(relative_path, relativePath);
} }
public FileRecord(String stored_f_name, String md5Checksum, String relativePath, String nodeIDStr) { public void setRelativePath(String relativePath) {
content.put(stored_file_name, stored_f_name); this.relative_path_value = relativePath;
content.put(md5_checksum, md5Checksum);
content.put(relative_path, relativePath);
content.put(nodeID, nodeIDStr);
} }
public HashMap getFileRecord() { public String getRelativePath() {
return content; return this.relative_path_value;
} }
public void setFileRecord(String stored_f_name, String md5Checksum, String relativePath) { public void setNodeId(String nodeId) {
content.put(stored_file_name, stored_f_name); this.nodeID_value = nodeId;
content.put(md5_checksum, md5Checksum);
content.put(relative_path, relativePath);
} }
public String getNodeId() {
return this.nodeID_value;
} }
public boolean getIfOperationSuccessful() {
return this.operationSuccessful_value;
}
public void setIfOperationSuccessful(boolean ifSuccess) {
this.operationSuccessful_value = ifSuccess;
}
public String toString() {
String res = "FileRecord: \nstored_file_name = " + getStoredfileName() + "\n"
+ "md5_checksum = " + getMD5Checksum() + "\n"
+ "relative_path = " + getRelativePath() + "\n"
+ "nodeID = " + getNodeId() + "\n"
+ "operationSuccessful = " + getIfOperationSuccessful() + "\n";
return res;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment