Code example for File

Methods: exists, length

0
	 */ 
	public static long getFileSize( String filePath )
	{ 
		long size = 0;
		 
		File file = new File( filePath );
		if(file!=null && file.exists())
		{ 
			size = file.length();
		}  
		return size;
	} 
	 
	/** 
	 * 获取文件大小 
	 * @param size 字节 
	 * @return 
	 */ 
	public static String getFileSize(long size) 
	{ 
		if (size <= 0)	return "0";