JAVA SE 中的File
import java.io.File;
public class FileTest{
public static void main(String[] args){
scan("c:/file/ss");
}
public static void scan(String path){
if(path ==null)
return ;
File file = new File(path); //生成一个新的虚拟文件路径
file.mkdirs(); //如果 ‘c:/file/ss’路径不存在,则生成新的文件夹及其父文件夹
String b = "aa.txt"; //在c:/file/ss 生成新文件的名字
File file1 = new File(file,b); //在父文件虚拟路径下c:/file/ss生成一个新的file
//file1.mkdirs();
try{
file1.createNewFile();} //创建这个文件
catch(Exception e){
e.printStackTrace();
}
}
}
相关文档:
用jpa不能建表,sql语句是对的,不过就是不能建,同样的sql,在下面的jdbc中就可以,可能是框架的限制,希望高人指点
import java.net.URL;
import java.sql.*;
public class Create {
public Create() {
}
public static void main(String[] args){
String url = "jdbc:oracle:thin:@10.0.1.3:1521:SDCDB" ......
Java中的transient,volatile和strictfp关键字
如果用transient声明一个实例变量,当对象存储时,它的值不需要维持。例如:
Java代码
class T {
transient int a; //不需要维持
int b; ......
public static void getConnAndTableStruct() {
Connection connection = null;
PreparedStatement pstmt = null;
ResultSetMetaData rsmd = null;
try {
// mysql连接
//Class.forName("org.gjt.mm.mysql.Driver");
//connection = DriverManager.g ......
公司Vac方法过滤器使用到反射机制,读取xml配置文件过滤用户访问的方法名是否合法。
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRe ......
一、主要功能:
1、支持纯数字、大写字母、小写字母,及两两混合或三者混合类型验证码;
2、支持自定义特殊字符排除(如0oOi1jI);
3、支持图片及文字两种类型验证码;
4、支持自定义验证码图片大小;
5、支持自定义干扰线条数;
6、支持自定义及随机定义图片、文字、干扰线颜色;
......