|
@@ -1104,9 +1104,9 @@ public class FileUtils {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String checkStaffFilePath(String fileName) {
|
|
|
+ public static String checkStaffFilePath(Context context, String fileName) {
|
|
|
try {
|
|
|
- String path = Environment.getExternalStorageDirectory() + "/dayaWhiteBroad/" + fileName;
|
|
|
+ String path = getWhiteBoardPath(context) + "/" + fileName;
|
|
|
File file = new File(path);
|
|
|
if (file.exists()) {
|
|
|
return file.getAbsolutePath();
|
|
@@ -1119,10 +1119,14 @@ public class FileUtils {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
+ public static String getWhiteBoardPath(Context context) {
|
|
|
+ return getCacheDir(context, "dayaWhiteBroad");
|
|
|
+ }
|
|
|
+
|
|
|
public static String getFilePath(Context context, Bitmap bitmap, String fileName) {
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
|
bitmap.compress(Bitmap.CompressFormat.PNG, 80, baos);
|
|
|
- String path = getCacheDir(context, "dayaWhiteBroad");
|
|
|
+ String path = getWhiteBoardPath(context);
|
|
|
File dir = new File(path);
|
|
|
if (!dir.exists()) {
|
|
|
dir.mkdirs();
|
|
@@ -1145,8 +1149,8 @@ public class FileUtils {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static String getFilePath(Context context,Bitmap bitmap) {
|
|
|
- return getFilePath(context,bitmap, String.valueOf(System.currentTimeMillis()));
|
|
|
+ public static String getFilePath(Context context, Bitmap bitmap) {
|
|
|
+ return getFilePath(context, bitmap, String.valueOf(System.currentTimeMillis()));
|
|
|
}
|
|
|
|
|
|
/**
|