新增获取不带后缀文件名称方法
This commit is contained in:
		
							parent
							
								
									0c820b96d8
								
							
						
					
					
						commit
						910fe6261b
					
				@ -257,8 +257,8 @@ public class FileUtils
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 获取名称
 | 
					     * 获取文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi.png
 | 
				
			||||||
     *  例如: /profile/upload/2022/04/16/ruoyi.png, 返回: ruoyi.png
 | 
					     * 
 | 
				
			||||||
     * @param fileName 路径名称
 | 
					     * @param fileName 路径名称
 | 
				
			||||||
     * @return 没有文件路径的名称
 | 
					     * @return 没有文件路径的名称
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
@ -275,13 +275,15 @@ public class FileUtils
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 获取名称
 | 
					     * 获取不带后缀文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi
 | 
				
			||||||
     * 例如: /profile/upload/2022/04/16/ruoyi.png, 返回: ruoyi
 | 
					     * 
 | 
				
			||||||
     * @param fileName 路径名称
 | 
					     * @param fileName 路径名称
 | 
				
			||||||
     * @return 没有文件路径的名称
 | 
					     * @return 没有文件路径和后缀的名称
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public static String getNameNotSuffix(String fileName) {
 | 
					    public static String getNameNotSuffix(String fileName)
 | 
				
			||||||
        if (fileName == null) {
 | 
					    {
 | 
				
			||||||
 | 
					        if (fileName == null)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
            return null;
 | 
					            return null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        String baseName = FilenameUtils.getBaseName(fileName);
 | 
					        String baseName = FilenameUtils.getBaseName(fileName);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user