diff --git a/cadc-pkg-server/build.gradle b/cadc-pkg-server/build.gradle index 7eaeb3f9..bb7c2abc 100644 --- a/cadc-pkg-server/build.gradle +++ b/cadc-pkg-server/build.gradle @@ -14,7 +14,7 @@ sourceCompatibility = 1.8 group = 'org.opencadc' -version = '1.2.1' +version = '1.2.2' description = 'OpenCADC CADC package server library' def git_url = 'https://github.com/opencadc/dal' diff --git a/cadc-pkg-server/src/main/java/org/opencadc/pkg/server/PackageItem.java b/cadc-pkg-server/src/main/java/org/opencadc/pkg/server/PackageItem.java index a7a8bd6f..bb081523 100644 --- a/cadc-pkg-server/src/main/java/org/opencadc/pkg/server/PackageItem.java +++ b/cadc-pkg-server/src/main/java/org/opencadc/pkg/server/PackageItem.java @@ -188,4 +188,19 @@ public boolean isSymbolicLink() { return linkTarget != null; } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("PackageItem[path=").append(relativePath); + if (isDirectory()) { + sb.append(",type=directory"); + } else if (isFile()) { + sb.append(",type=file"); + } else { + sb.append(",type=link,target=").append(linkTarget); + } + sb.append("]"); + return sb.toString(); + } + }