Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>From the Java documentation <a
* href="https://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">Standard
* charsets</a>:
*
* @return An immutable, case-insensitive map from canonical charset names to charset objects.
* @see Charset#availableCharsets()
* @since 2.5
*/
public static SortedMap<String, Charset> requiredCharsets() {
return STANDARD_CHARSET_MAP;
}

/**
* Returns the given Charset or the default Charset if the given Charset is null.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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 <T> type of exception to return.
* @param index index in the cause list.
* @return The list of causes.
*/
public <T extends Throwable> T getCause(final int index) {
return (T) causeList.get(index);
}

/**
* Gets the cause exception at the given index.
*
* @param <T> 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 extends Throwable> T getCause(final int index, final Class<T> clazz) {
return clazz.cast(getCause(index));
}

/**
* Gets the cause list.
*
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -112,14 +111,6 @@ void append(final Object[] array, final StringBuilder buffer) {
}
}

FileVisitResult get(final IOSupplier<FileVisitResult> supplier) {
try {
return supplier.get();
} catch (final IOException e) {
return handle(e);
}
}

/**
* Handles exceptions caught while accepting.
*
Expand Down
Loading
Loading