You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/10/17 22:30:42 UTC

[commons-vfs] branch master updated: [VFS-743] Add org.apache.commons.vfs2.provider.compressed.CompressedFileFileObject.SIZE_UNDEFINED.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new 865143a  [VFS-743] Add org.apache.commons.vfs2.provider.compressed.CompressedFileFileObject.SIZE_UNDEFINED.
865143a is described below

commit 865143a265e6e5ea31f2f95170ddb4177fc68818
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Oct 17 18:30:14 2019 -0400

    [VFS-743] Add
    org.apache.commons.vfs2.provider.compressed.CompressedFileFileObject.SIZE_UNDEFINED.
---
 .../vfs2/provider/compressed/CompressedFileFileObject.java        | 8 +++++++-
 src/changes/changes.xml                                           | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/compressed/CompressedFileFileObject.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/compressed/CompressedFileFileObject.java
index 4bad8e7..3c03485 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/compressed/CompressedFileFileObject.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/compressed/CompressedFileFileObject.java
@@ -34,6 +34,12 @@ import org.apache.commons.vfs2.provider.AbstractFileObject;
  */
 public abstract class CompressedFileFileObject<FS extends CompressedFileFileSystem> extends AbstractFileObject<FS> {
 
+    /**
+     * The value returned by {@link #doGetContentSize()} when not overriden by a subclass.
+     * 
+     * @since 2.5.0
+     */
+    public static final int SIZE_UNDEFINED = -1;
     private final FileObject container;
     private final String[] children;
 
@@ -86,7 +92,7 @@ public abstract class CompressedFileFileObject<FS extends CompressedFileFileSyst
      */
     @Override
     protected long doGetContentSize() {
-        return -1;
+        return SIZE_UNDEFINED;
     }
 
     /**
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index bbed4e4..9fc9f3f 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -107,6 +107,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action issue="VFS-742" dev="ggregory" type="add" due-to="Gary Gregory">
         Add org.apache.commons.vfs2.FileContent.isEmpty().
       </action>
+      <action issue="VFS-743" dev="ggregory" type="add" due-to="Gary Gregory">
+        Add org.apache.commons.vfs2.provider.compressed.CompressedFileFileObject.SIZE_UNDEFINED.
+      </action>
     </release>
     <release version="2.4.1" date="2019-08-10" description="Bug fix release.">
       <action issue="VFS-725" dev="ggregory" type="fix" due-to="Gary Gregory">