| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除某个文件 |
| | | * @param parentPathName 当前文件的父目录一直到根目录(不包括根目录) |
| | | * @param fileName 文件名 |
| | | */ |
| | | public static void deleteFile(String parentPathName, String fileName){ |
| | | String dir =Environment.getExternalStorageDirectory().getAbsolutePath()+"/"; |
| | | dir = dir+parentPathName; |
| | | MyLog.i(TAG,"删除文件"+dir+fileName); |
| | | File file = new File(dir,fileName); |
| | | if (file.exists()){ |
| | | file.delete(); |
| | | } |
| | | } |
| | | public static byte[] readLocalFile(Context context,String fileName) throws IOException { |
| | | InputStream inputStream = null; |
| | | String dir = Environment.getExternalStorageDirectory().getAbsolutePath()+"/"; |