All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.mmm.util.file.api.FileDeletionFailedException Maven / Gradle / Ivy

/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.file.api;

import java.io.File;

import net.sf.mmm.util.file.NlsBundleUtilFileRoot;
import net.sf.mmm.util.io.api.RuntimeIoException;

/**
 * A {@link FileDeletionFailedException} is thrown if a file or directory should be deleted but the deletion failed.
 *
 * @author Joerg Hohwiller (hohwille at users.sourceforge.net)
 * @since 2.0.0
 */
public class FileDeletionFailedException extends RuntimeIoException {

  private static final long serialVersionUID = 2351628909914860156L;

  /**
   * The constructor.
   *
   * @param file is the file that could NOT be deleted.
   */
  public FileDeletionFailedException(File file) {

    this(file.getAbsolutePath(), file.isDirectory());
  }

  /**
   * The constructor.
   *
   * @param file is the name of the file that could NOT be deleted.
   */
  public FileDeletionFailedException(String file) {

    this(file, false);
  }

  /**
   * The constructor.
   *
   * @param file is the name of the file that could NOT be deleted.
   * @param directory - {@code true} if the exception is about a directory, {@code false} if the exception is about a
   *        file.
   */
  public FileDeletionFailedException(String file, boolean directory) {

    super(createBundle(NlsBundleUtilFileRoot.class).errorFileDeletionFailed(file, directory));
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy