congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Files.deleteFile
Code IndexAdd Tabnine to your IDE (free)

How to use
deleteFile
method
in
org.nutz.lang.Files

Best Java code snippets using org.nutz.lang.Files.deleteFile (Showing top 15 results out of 315)

origin: nutzam/nutz

public void free() throws SQLException {
  Files.deleteFile(file);
}
origin: nutzam/nutz

public void free() throws SQLException {
  Files.deleteFile(file);
}
origin: nutzam/nutz

public synchronized File removeFile(long fId, String suffix) {
  File f = _F(fId, suffix);
  if (f.exists())
    Files.deleteFile(f);
  return f;
}
origin: nutzam/nutz

public File removeFile(long fId, String suffix) {
  File f = Pools.getFileById(home, fId, suffix);
  Files.deleteFile(f);
  return f;
}
origin: nutzam/nutz

/**
 * 清除一个目录里所有的内容
 * 
 * @param dir
 *            目录
 * @return 是否清除成功
 */
public static boolean clearDir(File dir) {
  if (null == dir)
    return false;
  if (!dir.exists())
    return false;
  File[] fs = dir.listFiles();
  if (fs != null) {
    for (File f : fs) {
      if (f.isFile())
        Files.deleteFile(f);
      else if (f.isDirectory())
        Files.deleteDir(f);
    }
  }
  return true;
}
origin: nutzam/nutz

/**
 * 强行删除一个目录,包括这个目录下所有的子目录和文件
 * 
 * @param dir
 *            目录
 * @return 是否删除成功
 */
public static boolean deleteDir(File dir) {
  if (null == dir || !dir.exists())
    return false;
  if (!dir.isDirectory())
    throw new RuntimeException("\"" + dir.getAbsolutePath() + "\" should be a directory!");
  File[] files = dir.listFiles();
  boolean re = false;
  if (null != files) {
    if (files.length == 0)
      return dir.delete();
    for (File f : files) {
      if (f.isDirectory())
        re |= deleteDir(f);
      else
        re |= deleteFile(f);
    }
    re |= dir.delete();
  }
  return re;
}
origin: nutzam/nutz

public File removeDir(long fId) {
  File f = Pools.getFileById(home, fId, null);
  if (f.isDirectory()) {
    Files.deleteDir(f);
  } else {
    Files.deleteFile(f);
  }
  return f;
}
origin: org.nutz/nutz

public void free() throws SQLException {
  Files.deleteFile(file);
}
origin: org.nutz/nutz

public void free() throws SQLException {
  Files.deleteFile(file);
}
origin: org.nutz/nutz

public File removeFile(long fId, String suffix) {
  File f = Pools.getFileById(home, fId, suffix);
  Files.deleteFile(f);
  return f;
}
origin: org.nutz/nutz

public synchronized File removeFile(long fId, String suffix) {
  File f = _F(fId, suffix);
  if (f.exists())
    Files.deleteFile(f);
  return f;
}
origin: nutzam/nutz-web

public void clear() {
  key = null;
  File f = Files.findFile(god_key_file_my);
  if (null != f)
    Files.deleteFile(f);
}
origin: org.nutz/nutz

/**
 * 清除一个目录里所有的内容
 * 
 * @param dir
 *            目录
 * @return 是否清除成功
 */
public static boolean clearDir(File dir) {
  if (null == dir)
    return false;
  if (!dir.exists())
    return false;
  File[] fs = dir.listFiles();
  if (fs != null) {
    for (File f : fs) {
      if (f.isFile())
        Files.deleteFile(f);
      else if (f.isDirectory())
        Files.deleteDir(f);
    }
  }
  return true;
}
origin: org.nutz/nutz

/**
 * 强行删除一个目录,包括这个目录下所有的子目录和文件
 * 
 * @param dir
 *            目录
 * @return 是否删除成功
 */
public static boolean deleteDir(File dir) {
  if (null == dir || !dir.exists())
    return false;
  if (!dir.isDirectory())
    throw new RuntimeException("\"" + dir.getAbsolutePath() + "\" should be a directory!");
  File[] files = dir.listFiles();
  boolean re = false;
  if (null != files) {
    if (files.length == 0)
      return dir.delete();
    for (File f : files) {
      if (f.isDirectory())
        re |= deleteDir(f);
      else
        re |= deleteFile(f);
    }
    re |= dir.delete();
  }
  return re;
}
origin: org.nutz/nutz

public File removeDir(long fId) {
  File f = Pools.getFileById(home, fId, null);
  if (f.isDirectory()) {
    Files.deleteDir(f);
  } else {
    Files.deleteFile(f);
  }
  return f;
}
org.nutz.langFilesdeleteFile

Javadoc

删除一个文件

Popular methods of Files

  • findFile
    从 CLASSPATH 下或从指定的本机器路径下寻找一个文件
  • createDirIfNoExists
    试图生成一个目录对象,如果文件不存在则创建它。 如果给出的 PATH 是相对路径 则会在 CLASSPATH 中寻找,如果未找到,则会在用户主目录中创建这个目录
  • createFileIfNoExists
    试图生成一个文件对象,如果文件不存在则创建它。 如果给出的 PATH 是相对路径 则会在 CLASSPATH 中寻找,如果未找到,则会在用户主目录中创建这个文件
  • getSuffixName
    获取文件后缀名,不包括 '.',如 'abc.gif',',则返回 'gif'
  • readBytes
    读取文件全部字节,并关闭文件
  • renameSuffix
    将文件路径后缀改名,从而生成一个新的文件路径。
  • write
    将内容写到一个文件内,内容对象可以是: * InputStream - 按二进制方式写入 * byte[] - 按二进制方式写入 * Reader - 按 UTF-8 方式写入 * 其他对象被
  • cleanAllFolderInSubFolderes
    将一个目录下的特殊名称的目录彻底删除,比如 '.svn' 或者 '.cvs'
  • findFileAsStream
    获取输出流
  • getName
  • makeDir
    创建新目录,如果父目录不存在,也一并创建。可接受 null 参数
  • read
    读取 UTF-8 文件全部内容
  • makeDir,
  • read,
  • checkFile,
  • clearDir,
  • copy,
  • copyDir,
  • copyFile,
  • copyOnWrite,
  • createNewFile

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now