Skip to content

Commit

Permalink
deprecate unnecessary method
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1914084 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pjfanning committed Nov 24, 2023
1 parent 9965dc7 commit 5d2f053
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
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
Expand Down Expand Up @@ -195,11 +196,19 @@ public static long getMaxTextSize() {
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();
Expand Down Expand Up @@ -229,7 +238,9 @@ public ZipArchiveThresholdInputStream getInputStream(ZipArchiveEntry entry) thro
/**
* 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;
}
Expand Down

0 comments on commit 5d2f053

Please sign in to comment.