フルパスを返すGetterを追加

This commit is contained in:
r-ca 2023-12-14 04:28:10 +09:00
parent 0540f775d3
commit 17bf162341
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -1,4 +1,41 @@
package one.nem.lacerta.model.document.path; package one.nem.lacerta.model.document.path;
import java.nio.file.Path;
import java.nio.file.Paths;
public class DocumentPath { public class DocumentPath {
String rootPath;
String path;
// Getter
public String getRootPath() {
return rootPath;
}
public String getPath() {
return path;
}
public Path getFullPath() {
// rootPathとpathを結合して返す
return Paths.get(rootPath, path);
}
public String getFullPathString() {
// rootPathとpathを結合して返す
return Paths.get(rootPath, path).toString();
}
// Setter
public void setRootPath(String rootPath) {
this.rootPath = rootPath;
}
public void setPath(String path) {
this.path = path;
}
} }