Class FileNameUtil

java.lang.Object
cn.hutool.v7.core.io.file.FileNameUtil
cn.toint.oktool.util.FileNameUtil

public class FileNameUtil extends cn.hutool.v7.core.io.file.FileNameUtil
Author:
Toint
  • Field Summary

    Fields inherited from class cn.hutool.v7.core.io.file.FileNameUtil

    EXT_CLASS, EXT_JAR, EXT_JAR_PATH, EXT_JAVA, SMB_PATH_PREFIX, UNIX_SEPARATOR, WINDOWS_SEPARATOR
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    renameMain(String filePath, String newFileMainName)
    重命名文件主名称(不会修改后缀)

    Methods inherited from class cn.hutool.v7.core.io.file.FileNameUtil

    addTempSuffix, cleanInvalid, containsInvalid, extName, extName, getName, getName, getPrefix, getPrefix, getSuffix, getSuffix, isType, mainName, mainName, normalize

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FileNameUtil

      public FileNameUtil()
  • Method Details

    • renameMain

      public static String renameMain(String filePath, String newFileMainName)
      重命名文件主名称(不会修改后缀)
      Parameters:
      filePath - 文件
      newFileMainName - 新的文件主名称(不含后缀)
      Returns:
      重命名后的文件名称