Exemplo n.º 1
0
 public void AddFile(FileHolder file) {
   if (files == null) return;
   synchronized (files) {
     files.add(file);
     SortFileHolder(files);
   }
   throwOnFileAdded(file.getFile());
 }
Exemplo n.º 2
0
 private boolean deleteFile(FileHolder file) {
   boolean del = false;
   bitmapHelper.DeleteCache(file.getFile());
   if (VERSION.SDK_INT <= VERSION_CODES.LOLLIPOP || file.getFile().canWrite()) {
     del = file.getFile().delete();
   }
   if (!del && VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) del = delteDocumentFile(file.getFile());
   if (del) {
     if (files != null) files.remove(file);
     throwOnFileDeleted(file.getFile());
   }
   MediaScannerManager.ScanMedia(getContext(), file.getFile());
   return del;
 }
Exemplo n.º 3
0
 /**
  * Loads the files stored from that folder
  *
  * @param fileHolder the folder to lookup
  * @param types the file format to load
  */
 @Override
 public void LoadFolder(FileHolder fileHolder, FormatTypes types) {
   files.clear();
   storageHandler.readFilesFromFolder(
       fileHolder.getFile(), files, types, fileHolder.isExternalSD());
 }