diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/Charsets.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/Charsets.java
index 2429385f2..7c89d0b02 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/Charsets.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/Charsets.java
@@ -146,22 +146,6 @@ public class Charsets {
*/
@Deprecated public static final Charset UTF_8 = StandardCharsets.UTF_8;
- /**
- * Constructs a sorted map from canonical charset names to charset objects required of every
- * implementation of the Java platform.
- *
- *
From the Java documentation Standard
- * charsets:
- *
- * @return An immutable, case-insensitive map from canonical charset names to charset objects.
- * @see Charset#availableCharsets()
- * @since 2.5
- */
- public static SortedMap requiredCharsets() {
- return STANDARD_CHARSET_MAP;
- }
-
/**
* Returns the given Charset or the default Charset if the given Charset is null.
*
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/IOExceptionList.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/IOExceptionList.java
index 30d8e35cd..f1c4e6791 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/IOExceptionList.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/IOExceptionList.java
@@ -66,15 +66,6 @@ private static String toMessage(final List extends Throwable> causeList) {
/** List of causes. */
private final List extends Throwable> causeList;
- /**
- * Constructs a new exception caused by a list of exceptions.
- *
- * @param causeList a list of cause exceptions.
- */
- public IOExceptionList(final List extends Throwable> causeList) {
- this(toMessage(causeList), causeList);
- }
-
/**
* Constructs a new exception caused by a list of exceptions.
*
@@ -89,29 +80,6 @@ public IOExceptionList(final String message, final List extends Throwable> cau
this.causeList = causeList == null ? Collections.emptyList() : causeList;
}
- /**
- * Gets the cause exception at the given index.
- *
- * @param type of exception to return.
- * @param index index in the cause list.
- * @return The list of causes.
- */
- public T getCause(final int index) {
- return (T) causeList.get(index);
- }
-
- /**
- * Gets the cause exception at the given index.
- *
- * @param type of exception to return.
- * @param index index in the cause list.
- * @param clazz type of exception to return.
- * @return The list of causes.
- */
- public T getCause(final int index, final Class clazz) {
- return clazz.cast(getCause(index));
- }
-
/**
* Gets the cause list.
*
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/RandomAccessFileMode.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/RandomAccessFileMode.java
deleted file mode 100644
index 13a1b3143..000000000
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/RandomAccessFileMode.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tsfile.external.commons.io;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.RandomAccessFile;
-import java.nio.file.Path;
-
-/**
- * Access modes and factory methods for {@link RandomAccessFile}.
- *
- * @since 2.12.0
- */
-public enum RandomAccessFileMode {
-
- /** Mode {@code "r"} opens for reading only. */
- READ_ONLY("r"),
-
- /** Mode {@code "rw"} opens for reading and writing. */
- READ_WRITE("rw"),
-
- /**
- * Mode {@code "rws"} opens for reading and writing, as with {@code "rw"}, and also require that
- * every update to the file's content or metadata be written synchronously to the underlying
- * storage device.
- */
- READ_WRITE_SYNC_ALL("rws"),
-
- /**
- * Mode {@code "rwd"} open for reading and writing, as with {@code "rw"}, and also require that
- * every update to the file's content be written synchronously to the underlying storage device.
- */
- READ_WRITE_SYNC_CONTENT("rwd");
-
- private final String mode;
-
- RandomAccessFileMode(final String mode) {
- this.mode = mode;
- }
-
- /**
- * Constructs a random access file stream to read from, and optionally to write to, the file
- * specified by the {@link File} argument.
- *
- * @param file the file object
- * @return a random access file stream
- * @throws FileNotFoundException See {@link RandomAccessFile#RandomAccessFile(File, String)}.
- */
- public RandomAccessFile create(final File file) throws FileNotFoundException {
- return new RandomAccessFile(file, mode);
- }
-
- /**
- * Constructs a random access file stream to read from, and optionally to write to, the file
- * specified by the {@link File} argument.
- *
- * @param file the file object
- * @return a random access file stream
- * @throws FileNotFoundException See {@link RandomAccessFile#RandomAccessFile(File, String)}.
- */
- public RandomAccessFile create(final Path file) throws FileNotFoundException {
- return create(file.toFile());
- }
-
- /**
- * Constructs a random access file stream to read from, and optionally to write to, the file
- * specified by the {@link File} argument.
- *
- * @param file the file object
- * @return a random access file stream
- * @throws FileNotFoundException See {@link RandomAccessFile#RandomAccessFile(File, String)}.
- */
- public RandomAccessFile create(final String file) throws FileNotFoundException {
- return new RandomAccessFile(file, mode);
- }
-
- @Override
- public String toString() {
- return mode;
- }
-}
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/RandomAccessFiles.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/RandomAccessFiles.java
deleted file mode 100644
index e69f79a1d..000000000
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/RandomAccessFiles.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.tsfile.external.commons.io;
-
-import java.io.IOException;
-import java.io.RandomAccessFile;
-
-/**
- * Works on RandomAccessFile.
- *
- * @since 2.13.0
- */
-public class RandomAccessFiles {
-
- /**
- * Reads a byte array starting at "position" for "length" bytes.
- *
- * @param input The source RandomAccessFile.
- * @param position The offset position, measured in bytes from the beginning of the file, at which
- * to set the file pointer.
- * @param length How many bytes to read.
- * @return a new byte array.
- * @throws IOException If the first byte cannot be read for any reason other than end of file, or
- * if the random access file has been closed, or if some other I/O error occurs.
- */
- public static byte[] read(final RandomAccessFile input, final long position, final int length)
- throws IOException {
- input.seek(position);
- return IOUtils.toByteArray(input::read, length);
- }
-}
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/build/AbstractOrigin.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/build/AbstractOrigin.java
index 5189dfa81..cd95d2360 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/build/AbstractOrigin.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/build/AbstractOrigin.java
@@ -104,12 +104,6 @@ public byte[] getByteArray() {
return origin.toString().getBytes(Charset.defaultCharset());
}
- @Override
- public CharSequence getCharSequence(final Charset charset) {
- // No conversion
- return get();
- }
-
@Override
public InputStream getInputStream(final OpenOption... options) throws IOException {
// TODO Pass in a Charset? Consider if call sites actually need this.
@@ -271,11 +265,6 @@ public byte[] getByteArray() throws IOException {
return IOUtils.toByteArray(origin, Charset.defaultCharset());
}
- @Override
- public CharSequence getCharSequence(final Charset charset) throws IOException {
- return IOUtils.toString(origin);
- }
-
@Override
public InputStream getInputStream(final OpenOption... options) throws IOException {
// TODO Pass in a Charset? Consider if call sites actually need this.
@@ -380,18 +369,6 @@ public byte[] getByteArray() throws IOException {
return Files.readAllBytes(getPath());
}
- /**
- * Gets this origin as a byte array, if possible.
- *
- * @param charset The charset to use if conversion from bytes is needed.
- * @return this origin as a byte array, if possible.
- * @throws IOException if an I/O error occurs.
- * @throws UnsupportedOperationException if the origin cannot be converted to a Path.
- */
- public CharSequence getCharSequence(final Charset charset) throws IOException {
- return new String(getByteArray(), charset);
- }
-
/**
* Gets this origin as a Path, if possible.
*
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/file/Counters.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/file/Counters.java
index 3c2fcf60e..82a00fcb1 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/file/Counters.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/file/Counters.java
@@ -162,15 +162,6 @@ public String toString() {
}
}
- /** Counts files, directories, and sizes, as a visit proceeds, using BigInteger numbers. */
- private static final class BigIntegerPathCounters extends AbstractPathCounters {
-
- /** Constructs a new initialized instance. */
- protected BigIntegerPathCounters() {
- super(bigIntegerCounter(), bigIntegerCounter(), bigIntegerCounter());
- }
- }
-
/** Counts using a number. */
public interface Counter {
@@ -370,15 +361,6 @@ public static Counter bigIntegerCounter() {
return new BigIntegerCounter();
}
- /**
- * Returns a new BigInteger PathCounters.
- *
- * @return a new BigInteger PathCounters.
- */
- public static PathCounters bigIntegerPathCounters() {
- return new BigIntegerPathCounters();
- }
-
/**
* Returns a new long Counter.
*
@@ -406,14 +388,4 @@ public static PathCounters longPathCounters() {
public static Counter noopCounter() {
return NoopCounter.INSTANCE;
}
-
- /**
- * Returns the no-op PathCounters.
- *
- * @return the no-op PathCounters.
- * @since 2.9.0
- */
- public static PathCounters noopPathCounters() {
- return NoopPathCounters.INSTANCE;
- }
}
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/file/DeletingPathVisitor.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/file/DeletingPathVisitor.java
index dcf56933a..c48ffef66 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/file/DeletingPathVisitor.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/file/DeletingPathVisitor.java
@@ -38,22 +38,6 @@ public class DeletingPathVisitor extends CountingPathVisitor {
private final boolean overrideReadOnly;
private final LinkOption[] linkOptions;
- /**
- * Constructs a new visitor that deletes files except for the files and directories explicitly
- * given.
- *
- * @param pathCounter How to count visits.
- * @param deleteOption How deletion is handled.
- * @param skip The files to skip deleting.
- * @since 2.8.0
- */
- public DeletingPathVisitor(
- final Counters.PathCounters pathCounter,
- final DeleteOption[] deleteOption,
- final String... skip) {
- this(pathCounter, PathUtils.noFollowLinkOptionArray(), deleteOption, skip);
- }
-
/**
* Constructs a new visitor that deletes files except for the files and directories explicitly
* given.
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/AbstractFileFilter.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/AbstractFileFilter.java
index 9b184a914..60a25f916 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/AbstractFileFilter.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/AbstractFileFilter.java
@@ -19,7 +19,6 @@
import org.apache.tsfile.external.commons.io.file.PathFilter;
import org.apache.tsfile.external.commons.io.file.PathVisitor;
-import org.apache.tsfile.external.commons.io.function.IOSupplier;
import java.io.File;
import java.io.FileFilter;
@@ -112,14 +111,6 @@ void append(final Object[] array, final StringBuilder buffer) {
}
}
- FileVisitResult get(final IOSupplier supplier) {
- try {
- return supplier.get();
- } catch (final IOException e) {
- return handle(e);
- }
- }
-
/**
* Handles exceptions caught while accepting.
*
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/FalseFileFilter.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/FalseFileFilter.java
deleted file mode 100644
index 94864427e..000000000
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/FalseFileFilter.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tsfile.external.commons.io.filefilter;
-
-import java.io.File;
-import java.io.Serializable;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Path;
-import java.nio.file.attribute.BasicFileAttributes;
-
-/**
- * A file filter that always returns false.
- *
- *
Deprecating Serialization
- *
- *
Serialization is deprecated and will be removed in 3.0.
- *
- * @since 1.0
- * @see FileFilterUtils#falseFileFilter()
- */
-public class FalseFileFilter implements IOFileFilter, Serializable {
-
- private static final String TO_STRING = Boolean.FALSE.toString();
-
- /**
- * Singleton instance of false filter.
- *
- * @since 1.3
- */
- public static final IOFileFilter FALSE = new FalseFileFilter();
-
- /**
- * Singleton instance of false filter. Please use the identical FalseFileFilter.FALSE constant.
- * The new name is more JDK 1.5 friendly as it doesn't clash with other values when using static
- * imports.
- */
- public static final IOFileFilter INSTANCE = FALSE;
-
- private static final long serialVersionUID = 6210271677940926200L;
-
- /** Restrictive constructor. */
- protected FalseFileFilter() {}
-
- /**
- * Returns false.
- *
- * @param file the file to check (ignored)
- * @return false
- */
- @Override
- public boolean accept(final File file) {
- return false;
- }
-
- /**
- * Returns false.
- *
- * @param dir the directory to check (ignored)
- * @param name the file name (ignored)
- * @return false
- */
- @Override
- public boolean accept(final File dir, final String name) {
- return false;
- }
-
- /**
- * Returns false.
- *
- * @param file the file to check (ignored)
- * @return false
- * @since 2.9.0
- */
- @Override
- public FileVisitResult accept(final Path file, final BasicFileAttributes attributes) {
- return FileVisitResult.TERMINATE;
- }
-
- @Override
- public IOFileFilter and(final IOFileFilter fileFilter) {
- // FALSE AND expression <=> FALSE
- return INSTANCE;
- }
-
- @Override
- public IOFileFilter or(final IOFileFilter fileFilter) {
- // FALSE OR expression <=> expression
- return fileFilter;
- }
-
- @Override
- public String toString() {
- return TO_STRING;
- }
-}
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/IOFileFilter.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/IOFileFilter.java
index 3dea15de3..a18330674 100644
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/IOFileFilter.java
+++ b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/IOFileFilter.java
@@ -35,9 +35,6 @@
*/
public interface IOFileFilter extends FileFilter, FilenameFilter, PathFilter, PathMatcher {
- /** An empty String array. */
- String[] EMPTY_STRING_ARRAY = {};
-
/**
* Tests if a File should be accepted by this filter.
*
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/NotFileFilter.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/NotFileFilter.java
deleted file mode 100644
index 8a81915ea..000000000
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/filefilter/NotFileFilter.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tsfile.external.commons.io.filefilter;
-
-import java.io.File;
-import java.io.Serializable;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Path;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.Objects;
-
-/**
- * This filter produces a logical NOT of the filters specified.
- *
- *
Deprecating Serialization
- *
- *
Serialization is deprecated and will be removed in 3.0.
- *
- * @since 1.0
- * @see FileFilterUtils#notFileFilter(IOFileFilter)
- */
-public class NotFileFilter extends AbstractFileFilter implements Serializable {
-
- private static final long serialVersionUID = 6131563330944994230L;
-
- /** The filter */
- private final IOFileFilter filter;
-
- /**
- * Constructs a new file filter that NOTs the result of another filter.
- *
- * @param filter the filter, must not be null
- * @throws NullPointerException if the filter is null
- */
- public NotFileFilter(final IOFileFilter filter) {
- Objects.requireNonNull(filter, "filter");
- this.filter = filter;
- }
-
- /**
- * Returns the logical NOT of the underlying filter's return value for the same File.
- *
- * @param file the File to check
- * @return true if the filter returns false
- */
- @Override
- public boolean accept(final File file) {
- return !filter.accept(file);
- }
-
- /**
- * Returns the logical NOT of the underlying filter's return value for the same arguments.
- *
- * @param file the File directory
- * @param name the file name
- * @return true if the filter returns false
- */
- @Override
- public boolean accept(final File file, final String name) {
- return !filter.accept(file, name);
- }
-
- /**
- * Returns the logical NOT of the underlying filter's return value for the same File.
- *
- * @param file the File to check
- * @return true if the filter returns false
- * @since 2.9.0
- */
- @Override
- public FileVisitResult accept(final Path file, final BasicFileAttributes attributes) {
- return not(filter.accept(file, attributes));
- }
-
- private FileVisitResult not(final FileVisitResult accept) {
- return accept == FileVisitResult.CONTINUE
- ? FileVisitResult.TERMINATE
- : FileVisitResult.CONTINUE;
- }
-
- /**
- * Provide a String representation of this file filter.
- *
- * @return a String representation
- */
- @Override
- public String toString() {
- return "NOT (" + filter.toString() + ")";
- }
-}
diff --git a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/function/Constants.java b/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/function/Constants.java
deleted file mode 100644
index 1041a3286..000000000
--- a/java/tsfile/src/main/java/org/apache/tsfile/external/commons/io/function/Constants.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.tsfile.external.commons.io.function;
-
-/** Defines package-private constants. */
-final class Constants {
-
- /** No-op singleton. */
- @SuppressWarnings("rawtypes")
- static final IOBiConsumer IO_BI_CONSUMER =
- (t, u) -> {
- /* No-op */
- };
-
- /** No-op singleton. */
- static final IORunnable IO_RUNNABLE =
- () -> {
- /* No-op */
- };
-
- /** No-op singleton. */
- @SuppressWarnings("rawtypes")
- static final IOBiFunction IO_BI_FUNCTION = (t, u) -> null;
-
- /** No-op singleton. */
- @SuppressWarnings("rawtypes")
- static final IOFunction IO_FUNCTION_ID = t -> t;
-
- /** Always false. */
- static final IOPredicate