📄 validfilename.java
字号:
/*
* ValidFileName.java
*
* Created on 17 March 2006, 17:56
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package issrg.config.files;
/**
*
* @author ls97
*/
public class ValidFileName {
/** Creates a new instance of ValidFileName */
public ValidFileName() {
}
/** to get a valid URL according to a filename
* @param fileName, which is a file name. The file is allocated in the server at the same
* directory as this class is
* @return in, otherwise an exception is thrown
*/
public String getName(String fileName) throws ValidFileNameException{
java.net.URL configURL = this.getClass().getResource(fileName);
if (configURL == null) {
throw new ValidFileNameException("file not found: "+fileName);
}
String name = configURL.getFile();
name = name.replaceAll("%20", " ");
name = name.replace('\\', '/');
return name;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -