Tabnine Logo
FileUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
FileUtil
in
com.oklib.camera.z_help

Best Java code snippets using com.oklib.camera.z_help.FileUtil (Showing top 6 results out of 315)

origin: huangweicai/OkLibDemo

/**
 * 删除文件夹
 * 
 *            String 文件夹路径及名称 如/sdcard/data/
 *            String
 * @return boolean
 */
public static void delFolder(String folderPath) {
  try {
    delAllFile(folderPath); // 删除完里面所有内容
    String filePath = folderPath;
    filePath = filePath.toString();
    File myFilePath = new File(filePath);
    myFilePath.delete(); // 删除空文件夹
  } catch (Exception e) {
    System.out.println("删除文件夹操作出错");
    e.printStackTrace();
  }
}
origin: huangweicai/OkLibDemo

public static String getRandomImageFilePath() {
  return getPublicFilePath(TYPE_IMAGE);
}
origin: huangweicai/OkLibDemo

/**
 * Create a file for saving an image or video,is default in the
 * ../Pictures/[you app PackageName] directory
 *
 * @param context
 * @param type    the type of the file you want saved {@link #MEDIA_TYPE_IMAGE}
 *                {@link #MEDIA_TYPE_VIDEO}
 * @return return the file you create,if create failed,return null
 */
private static File getOutputMediaFile(Context context, int type) {
  String filePath = null;
  if (type == MEDIA_TYPE_IMAGE) {
    filePath = FileUtil.getRandomImageFilePath();
  } else if (type == MEDIA_TYPE_VIDEO) {
    //filePath = FileUtil.getRandomVideoFilePath();
  } else {
    return null;
  }
  if (TextUtils.isEmpty(filePath)) {
    return null;
  } else {
    return new File(filePath);
  }
}
origin: huangweicai/OkLibDemo

delAllFile(path + "/" + tempList[i]); // 先删除文件夹里面的文件
delFolder(path + "/" + tempList[i]); // 再删除空文件夹
origin: huangweicai/OkLibDemo

if (CameraManager.mNewPhotoUri != null) {
  CameraManager.mCurrentFile = new File(CameraManager.mNewPhotoUri.getPath());
  CameraManager.mlocitionFileUrl = FileUtil.getRealFilePath(context, CameraManager.mNewPhotoUri);
origin: huangweicai/OkLibDemo

if (CameraManager.mNewPhotoUri != null) {
  CameraManager.mCurrentFile = new File(CameraManager.mNewPhotoUri.getPath());
  CameraManager.mlocitionFileUrl = FileUtil.getRealFilePath(context, CameraManager.mNewPhotoUri);
com.oklib.camera.z_helpFileUtil

Most used methods

  • delAllFile
    删除文件夹里面的所有文件
  • delFolder
    删除文件夹 String 文件夹路径及名称 如/sdcard/data/ String
  • getPublicFilePath
    #TYPE_IMAGE #TYPE_ADUIO #TYPE_VIDEO
  • getRandomImageFilePath
  • getRealFilePath
    在Android 编程中经常会用到uri转化为文件路径 下面是4.4后通过Uri获取路径以及文件名一种方法

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now