示例#1
0
 /** Deletes the content of a shard store. Be careful calling this!. */
 public void deleteContent() throws IOException {
   ensureOpen();
   String[] files = directory.listAll();
   IOException lastException = null;
   for (String file : files) {
     if (isChecksum(file)) {
       try {
         directory.deleteFileChecksum(file);
       } catch (IOException e) {
         lastException = e;
       }
     } else {
       try {
         directory.deleteFile(file);
       } catch (NoSuchFileException | FileNotFoundException e) {
         // ignore
       } catch (IOException e) {
         lastException = e;
       }
     }
   }
   if (lastException != null) {
     throw lastException;
   }
 }