Newer
Older
/*
* This file is part of vospace-file-service
* Copyright (C) 2021 Istituto Nazionale di Astrofisica
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package it.inaf.ia2.transfer.persistence.model;
private int nodeId;
private String osPath;
Sonia Zorba
committed
private String virtualName;
private String fsPath;
// actualBasePath differs from base path in db due to some location type
// dependent manipulations (performed by FileDAO)
private boolean virtualParent;
private boolean directory;
private List<String> groupRead;
private List<String> groupWrite;
private List<String> acceptViews;
private List<String> provideViews;
Nicola Fulvio Calabria
committed
private String contentType;
private String contentEncoding;
private Long contentLength;
private String contentMd5;
Sonia Zorba
committed
private Integer locationId;
Sonia Zorba
committed
private String locationType;
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
public int getNodeId() {
return nodeId;
Nicola Fulvio Calabria
committed
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public String getContentEncoding() {
return contentEncoding;
}
public void setContentEncoding(String contentEncoding) {
this.contentEncoding = contentEncoding;
}
public Long getContentLength() {
return contentLength;
}
public void setContentLength(Long contentLength) {
this.contentLength = contentLength;
}
public String getContentMd5() {
return contentMd5;
}
public void setContentMd5(String contentMd5) {
this.contentMd5 = contentMd5;
}
public void setNodeId(int nodeId) {
this.nodeId = nodeId;
}
public String getOsPath() {
return osPath;
}
public void setOsPath(String osPath) {
this.osPath = osPath;
public String getVirtualPath() {
return virtualPath;
}
public void setVirtualPath(String virtualPath) {
this.virtualPath = virtualPath;
}
Sonia Zorba
committed
public String getVirtualName() {
return virtualName;
}
public void setVirtualName(String virtualName) {
this.virtualName = virtualName;
}
public boolean isPublic() {
public void setPublic(boolean isPublic) {
public boolean isDirectory() {
return directory;
}
public void setDirectory(boolean directory) {
this.directory = directory;
}
Sonia Zorba
committed
public boolean isLink() {
return link;
}
public void setLink(boolean link) {
this.link = link;
}
public boolean hasVirtualParent() {
return virtualParent;
}
public void setVirtualParent(boolean virtualParent) {
this.virtualParent = virtualParent;
}
public List<String> getGroupRead() {
return groupRead;
}
public void setGroupRead(List<String> groupRead) {
this.groupRead = groupRead;
}
public List<String> getGroupWrite() {
return groupWrite;
}
public void setGroupWrite(List<String> groupWrite) {
this.groupWrite = groupWrite;
}
public String getOwnerId() {
return ownerId;
}
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
public boolean isAsyncTrans() {
return asyncTrans;
}
public void setAsyncTrans(boolean asyncTrans) {
this.asyncTrans = asyncTrans;
}
public List<String> getAcceptViews() {
return acceptViews;
}
public void setAcceptViews(List<String> acceptViews) {
this.acceptViews = acceptViews;
}
public List<String> getProvideViews() {
return provideViews;
}
public void setProvideViews(List<String> provideViews) {
this.provideViews = provideViews;
}
Sonia Zorba
committed
public Integer getLocationId() {
return locationId;
}
public void setLocationId(Integer locationId) {
this.locationId = locationId;
}
Sonia Zorba
committed
public String getLocationType() {
return locationType;
}
public void setLocationType(String locationType) {
this.locationType = locationType;
}
public String getJobId() {
return jobId;
}
public void setJobId(String jobId) {
this.jobId = jobId;
}
Sonia Zorba
committed
public String getFsPath() {
return fsPath;
}
public void setFsPath(String fsPath) {
this.fsPath = fsPath;
}
public String getActualBasePath() {
return actualBasePath;
}
public void setActualBasePath(String actualBasePath) {
this.actualBasePath = actualBasePath;
}
// This function returns the full path of this file on storage
public String getFilePath() {
if (this.actualBasePath == null || this.fsPath == null) {
return null;
} else {
return Path.of(this.actualBasePath).resolve(this.fsPath).toString();
}
}
public static String getVosParentPath(FileInfo fileInfo) {
Sonia Zorba
committed
return fileInfo.getVirtualPath().substring(0, fileInfo.getVirtualPath().lastIndexOf("/"));