資源簡介
jsp編輯器很好用的 本人經過測試!jsp在線編輯器

代碼片段和文件信息
package?com.vsked.fileoperate;
/*
?*?To?change?this?template?choose?Tools?|?Templates
?*?and?open?the?template?in?the?editor.
?*/
/**
?*
?*?@author?非滅天
?*/
import?java.io.*;
public?class?CreateFileUtil?{
????/**
?????*?創建文件
?????*?@param?destFileName?文件名稱
?????*?@return
?????*/
????public?static?boolean?CreateFile(String?destFileName)?{
????????File?file?=?new?File(destFileName);
????????if?(file.exists())?{
????????????System.out.println(“創建單個文件“?+?destFileName?+?“失敗,目標文件已存在!“);
????????????return?false;
????????}
????????if?(destFileName.endsWith(File.separator))?{
????????????System.out.println(“創建單個文件“?+?destFileName?+?“失敗,目標不能是目錄!“);
????????????return?false;
????????}
????????if?(!file.getParentFile().exists())?{
???????????//?System.out.println(“目標文件所在路徑不存在,準備創建。。?!埃?
????????????if?(!file.getParentFile().mkdirs())?{
???????????????//?System.out.println(“創建目錄文件所在的目錄失??!“);
????????????????return?false;
????????????}
????????}
????????//?創建目標文件
????????try?{
????????????if?(file.createNewFile())?{
???????????????//?System.out.println(“創建單個文件“?+?destFileName?+?“成功!“);
????????????????return?true;
????????????}?else?{
????????????????System.out.println(“創建單個文件“?+?destFileName?+?“失??!“);
????????????????return?false;
????????????}
????????}?catch?(IOException?e)?{
????????????e.printStackTrace();
????????????System.out.println(“創建單個文件“?+?destFileName?+?“失?。 埃?
????????????return?false;
????????}
????}//end?method?create?method
????/**
?????*?創建目錄
?????*?@param?destDirName?目錄名稱
?????*?@return?boolean
?????*/
????public?static?boolean?createDir(String?destDirName)?{
????????File?dir?=?new?File(destDirName);
????????if?(dir.exists())?{
???????????System.out.println(“創建目錄“?+?destDirName?+?“失敗,目標目錄已存在!“);
????????????return?false;
????????}
????????if?(!destDirName.endsWith(File.separator))?{
????????????destDirName?=?destDirName?+?File.separator;
????????}
????????//?創建單個目錄
????????if?(dir.mkdirs())?{
???????????//?System.out.println(“創建目錄“?+?destDirName?+?“成功!“);
????????????return?true;
????????}?else?{
???????????//?System.out.println(“創建目錄“?+?destDirName?+?“成功!“);
????????????return?false;
????????}
????}//end?method?createDir
????/**
?????*?3*.?從輸入流中拷貝內容到輸入流中
?????*?@throws?IOException
?????*/
????public?void?copyStream(InputStream?is?OutputStream?os)?{
????????try?{
????????????//?這個讀過過程可以參閱?readToBuffer?中的注釋
????????????String?line;
????????????BufferedReader?reader?=?new?BufferedReader(new?InputStreamReader(is));
????????????PrintWriter?writer?=?new?PrintWriter(new?OutputStreamWriter(os));
????????????line?=?reader.readLine();
????????????while?(line?!=?null)?{
????????????????writer.println(line);
????????????????line?=?reader.readLine();
????????????}
????????????writer.flush();?????//?最后確定要把輸出流中的東西都寫出去了
????????}?catch?(Exception?e)?{
????????????e.printStackTrace();
????????}
????}//end?copyStream?method
????/**
?????*?復制文件
??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????I.A....???????440??2010-07-04?11:48??JspSinaEditor\.classpath
????I.A....???????312??2010-07-04?11:08??JspSinaEditor\.myme
????I.A....??????1419??2010-06-28?11:27??JspSinaEditor\.project
????I.A....???????500??2010-06-28?11:23??JspSinaEditor\.settings\.jsdtscope
????I.A....????????49??2010-06-28?11:23??JspSinaEditor\.settings\org.eclipse.wst.jsdt.ui.superType.container
????I.A....?????????6??2010-06-28?11:23??JspSinaEditor\.settings\org.eclipse.wst.jsdt.ui.superType.name
????I.A....??????4252??2010-06-20?00:43??JspSinaEditor\src\com\vsked\fileoperate\CreateFileUtil.java
????I.A....??????1056??2009-06-27?12:47??JspSinaEditor\src\com\vsked\fileoperate\FilesOperate.java
????I.A....??????1914??2010-06-19?15:17??JspSinaEditor\src\com\vsked\fileoperate\TestFile.java
????I.A....???????635??2010-06-28?12:15??JspSinaEditor\WebRoot\index.jsp
????I.A....????????39??2010-06-28?11:23??JspSinaEditor\WebRoot\me
????I.A....???????278??2010-07-04?12:22??JspSinaEditor\WebRoot\readme.txt
????I.A....???????709??2010-06-28?11:32??JspSinaEditor\WebRoot\receveData.jsp
????I.A....??????4263??2010-07-04?12:09??JspSinaEditor\WebRoot\sinaEditor\Edit\editor\attach.htm
????I.A....??????2912??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\editor\ba
????I.A....?????47654??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\editor\editor.js
????I.A....??????4160??2010-07-04?12:09??JspSinaEditor\WebRoot\sinaEditor\Edit\editor\img.htm
????I.A....??????3219??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\editor\li
????I.A....??????4595??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\editor\table.htm
????I.A....??????3121??2010-07-04?12:19??JspSinaEditor\WebRoot\sinaEditor\Edit\editor\upload.jsp
????I.A....??????3954??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\editor.htm
????I.A....???????887??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\face\001.gif
????I.A....??????2225??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\face\002.gif
????I.A....??????1498??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\face\003.gif
????I.A....??????1022??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\face\004.gif
????I.A....???????818??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\face\005.gif
????I.A....???????856??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\face\006.gif
????I.A....??????1153??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\face\007.gif
????I.A....??????1202??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\face\008.gif
????I.A....??????1028??2010-06-28?11:24??JspSinaEditor\WebRoot\sinaEditor\Edit\face\009.gif
............此處省略148個文件信息
評論
共有 條評論