Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
What Is commons-io-2.11.jar
What Is commons-io-2.11.jar?
✍: FYIcenter.com
commons-io-2.11.jar is the JAR file for Commons IO 2.5,
which is a library of utilities to assist with developing IO functionality.
JAR File Size and Download Location:
JAR name: commons-io-2.11.0.jar Target JDK version: 8 Dependency: None File name: commons-io.jar, commons-io-2.11.0.jar File size: 327135 bytes Release date: 01-22-2020 Download: Apache Commons IO Website
Java source code files for commons-io-2.11.jar are:
⏎ org/apache/commons/io/FileDeleteStrategy.java
/* * 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.commons.io; import java.io.File; import java.io.IOException; /** * Strategy for deleting files. * <p> * There is more than one way to delete a file. * You may want to limit access to certain directories, to only delete * directories if they are empty, or maybe to force deletion. * </p> * <p> * This class captures the strategy to use and is designed for user subclassing. * </p> * * @since 1.3 */ public class FileDeleteStrategy { /** * Force file deletion strategy. */ static class ForceFileDeleteStrategy extends FileDeleteStrategy { /** Default Constructor */ ForceFileDeleteStrategy() { super("Force"); } /** * Deletes the file object. * <p> * This implementation uses {@code FileUtils.forceDelete()} * if the file exists. * </p> * * @param fileToDelete the file to delete, not null * @return Always returns {@code true} * @throws NullPointerException if the file is null * @throws IOException if an error occurs during file deletion */ @Override protected boolean doDelete(final File fileToDelete) throws IOException { FileUtils.forceDelete(fileToDelete); return true; } } /** * The singleton instance for normal file deletion, which does not permit * the deletion of directories that are not empty. */ public static final FileDeleteStrategy NORMAL = new FileDeleteStrategy("Normal"); /** * The singleton instance for forced file deletion, which always deletes, * even if the file represents a non-empty directory. */ public static final FileDeleteStrategy FORCE = new ForceFileDeleteStrategy(); /** The name of the strategy. */ private final String name; /** * Restricted constructor. * * @param name the name by which the strategy is known */ protected FileDeleteStrategy(final String name) { this.name = name; } /** * Deletes the file object, which may be a file or a directory. * If the file does not exist, the method just returns. * <p> * Subclass writers should override {@link #doDelete(File)}, not this method. * </p> * * @param fileToDelete the file to delete, not null * @throws NullPointerException if the file is null * @throws IOException if an error occurs during file deletion */ public void delete(final File fileToDelete) throws IOException { if (fileToDelete.exists() && !doDelete(fileToDelete)) { throw new IOException("Deletion failed: " + fileToDelete); } } /** * Deletes the file object, which may be a file or a directory. * All {@code IOException}s are caught and false returned instead. * If the file does not exist or is null, true is returned. * <p> * Subclass writers should override {@link #doDelete(File)}, not this method. * </p> * * @param fileToDelete the file to delete, null returns true * @return true if the file was deleted, or there was no such file */ public boolean deleteQuietly(final File fileToDelete) { if (fileToDelete == null || !fileToDelete.exists()) { return true; } try { return doDelete(fileToDelete); } catch (final IOException ex) { return false; } } /** * Actually deletes the file object, which may be a file or a directory. * <p> * This method is designed for subclasses to override. * The implementation may return either false or an {@code IOException} * when deletion fails. The {@link #delete(File)} and {@link #deleteQuietly(File)} * methods will handle either response appropriately. * A check has been made to ensure that the file will exist. * </p> * <p> * This implementation uses {@link FileUtils#delete(File)}. * </p> * * @param file the file to delete, exists, not null * @return true if the file was deleted * @throws NullPointerException if the file is null * @throws IOException if an error occurs during file deletion */ protected boolean doDelete(final File file) throws IOException { FileUtils.delete(file); return true; } /** * Gets a string describing the delete strategy. * * @return a string describing the delete strategy */ @Override public String toString() { return "FileDeleteStrategy[" + name + "]"; } }
⏎ org/apache/commons/io/FileDeleteStrategy.java
Or download all of them as a single archive file:
File name: commons-io-2.11.0-sources.jar File size: 398939 bytes Release date: 2020-01-22 Download
⇒ Download and Install commons-io-2.6-bin.zip
⇐ What Is commons-io-2.11-bin.zip
2022-11-10, 68690👍, 2💬
Popular Posts:
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime e...
Apache Log4j SLF4J Binding allows applications coded to the SLF4J API to use Log4j 2 as the implemen...
JDK 11 jdk.hotspot.agent.jmod is the JMOD file for JDK 11 Hotspot Agent module. JDK 11 Hotspot Agent...
Apache Ant is a Java-based build tool. In theory, it is kind of like make, without make's wrinkles. ...
JDK 11 java.base.jmod is the JMOD file for JDK 11 Base module. JDK 11 Base module compiled class fil...