diff options
author | PJ Fanning <fanningpj@apache.org> | 2023-11-24 11:07:44 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2023-11-24 11:07:44 +0000 |
commit | 5d2f05376907b4e1816d79f3884d261281884a57 (patch) | |
tree | e07c60974c5c42d77690cbc22a714fc6be3f4a6a /poi-ooxml | |
parent | 9965dc74db1c44ed9f30c99290405e6976ad0d08 (diff) | |
download | poi-5d2f05376907b4e1816d79f3884d261281884a57.tar.gz poi-5d2f05376907b4e1816d79f3884d261281884a57.zip |
deprecate unnecessary method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1914084 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipSecureFile.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipSecureFile.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipSecureFile.java index 18509302d1..48d0792ff7 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipSecureFile.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/util/ZipSecureFile.java @@ -24,6 +24,7 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipFile; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.poi.util.Removal; /** * This class wraps a {@link ZipFile} in order to check the @@ -195,11 +196,19 @@ public class ZipSecureFile extends ZipFile { return MAX_TEXT_SIZE; } + /** + * @param file the {@link File}, possibly including path traversal - it is up to users to validate that the input value is safe + * @throws IOException if an error occurs while reading the file. + */ public ZipSecureFile(File file) throws IOException { super(file); this.fileName = file.getAbsolutePath(); } + /** + * @param name the file name, possibly including path traversal - it is up to users to validate that the input value is safe + * @throws IOException if an error occurs while reading the file. + */ public ZipSecureFile(String name) throws IOException { super(name); this.fileName = new File(name).getAbsolutePath(); @@ -229,7 +238,9 @@ public class ZipSecureFile extends ZipFile { /** * Returns the path name of the ZIP file. * @return the path name of the ZIP file + * @deprecated there is no need for this method - it will be removed in a future version of POI */ + @Removal(version = "7.0.0") public String getName() { return fileName; } |