Codota Logo
Files.getName
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: nutzam/nutz

/**
 * @param f
 *            文件对象
 * @return 文件或者目录名
 */
public static String getName(File f) {
  return getName(f.getPath());
}
origin: org.nutz/nutz

/**
 * @param f
 *            文件对象
 * @return 文件或者目录名
 */
public static String getName(File f) {
  return getName(f.getPath());
}
origin: stackoverflow.com

 public class FileCopy {

  public static void main(String[] args) {

    File folder= new File("Tango");
    File[] files = folder.listFiles();

    for (Files file : files ) {
         String filename = file.getName().substring(0,file.getName().indexOf("."));
         File yourDir= new File(filename); 

       if (!yourDir.exists()) {
           yourDir.mkDir();
         }

        file.renameTo(new File(yourDir.getAbsolutePath() + file.getName()));
    }
  }
}
org.nutz.langFilesgetName

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'
  • deleteFile
    删除一个文件
  • findFileAsStream
    获取输出流
  • makeDir
    创建新目录,如果父目录不存在,也一并创建。可接受 null 参数
  • read
    读取 UTF-8 文件全部内容
  • makeDir,
  • read,
  • checkFile,
  • clearDir,
  • copy,
  • copyDir,
  • copyFile,
  • copyOnWrite,
  • createNewFile

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JPanel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now