`

用apache common io包获得文件扩展名

 
阅读更多
apache common io包包含了很多非常实用的工具类,比如
连获得文件的扩展名都有了

import org.apache.commons.io.FilenameUtils; 
String extension = FilenameUtils.getExtension(fileName);  
              
if (extension.equals("zip") || extension.equals("bar")) {  
                ZipInputStream zip = new ZipInputStream(fileInputStream);  
                repositoryService.createDeployment().addZipInputStream(zip).deploy();  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics