请问各位,怎样让新建的文件放在指定的目录里?
现在自动生成的文件是放在服务器目录里。生成文件语句如下:
public void createFile() throws FileNotFoundException
{
try{
File f= new File("file1.txt");
if(!f.exists())
f.createNewFile();}
catch(Exception e)
{}
}
生成的file1.txt文件在resin2.1.6的目录中。我想把它放在文件相对目录里,怎么做?