Examples of moveToTrash()


Examples of com.googlecode.gmail4j.javamail.ImapGmailClient.moveToTrash()

            log.debug("Starting to move message(s) to trash folder.");
            // moving single GmailMessage to trash folder
            //GmailMessage[] jmgms = new JavaMailGmailMessage[1];
            //jmgms[0] = messages.get(0);
            //client.moveToTrash(jmgms);
            client.moveToTrash(messages.toArray(new JavaMailGmailMessage[0]));
            log.debug("Finished moving all selected message(s) to trash.");
            assertTrue("All unread messages are moved to trash.",
                    client.getUnreadMessages().isEmpty());
        } catch (final Exception e) {
            log.error("Test Failed", e);
View Full Code Here

Examples of com.googlecode.gmail4j.javamail.ImapGmailClient.moveToTrash()

            log.debug("Starting to move message(s) to trash folder.");
            // moving single GmailMessage to trash folder
            //GmailMessage[] jmgms = new JavaMailGmailMessage[1];
            //jmgms[0] = messages.get(0);
            //client.moveToTrash(jmgms);
            client.moveToTrash(messages.toArray(new JavaMailGmailMessage[0]));
            log.debug("Finished moving all selected message(s) to trash.");
            assertTrue("All unread messages are moved to trash.",
                    client.getUnreadMessages().isEmpty());
        } catch (final Exception e) {
            log.error("Test Failed", e);
View Full Code Here

Examples of org.apache.hadoop.fs.Trash.moveToTrash()

                + "\", if recursive deletion was not specified");
          }
          if (!skipTrash) {
            try {
              Trash trashTmp = new Trash(srcFs, configuration);
              trashTmp.moveToTrash(p);
            } catch (IOException ex) {
              throw new HadoopException("Cannot move to Trash resource " + p, ex);
            }
          }
          srcFs.delete(p, recursive);
View Full Code Here

Examples of org.apache.hadoop.fs.Trash.moveToTrash()

  }

    public static void moveToTrash(Configuration conf, Path path)
      throws IOException {
  Trash t = new Trash(conf);
  boolean isMoved = t.moveToTrash(path);
  t.expunge();
  if (!isMoved) {
      logger.error("Trash is not enabled or file is already in the trash.");
  }
    }
View Full Code Here

Examples of org.apache.hadoop.fs.Trash.moveToTrash()

    try {
      if(!fs.exists(f)) {
        return false;
      }
      Trash trashTmp = new Trash(fs.getConf());
      if (trashTmp.moveToTrash(f)) {
        LOG.info("Moved to trash: " + f);
        return true;
      }
      if (fs.delete(f, true)) {
        LOG.info("Deleted the diretory " + f);
View Full Code Here

Examples of org.apache.hadoop.fs.Trash.moveToTrash()

          // start deleting files, if we do not finish they will be cleaned
          // up later
          Trash trash = new Trash(fs, fs.getConf());
          for (Path path : oldDatafiles) {
            Path deleteFile = new Path(location + "/delete+" + compactName + "+" + path.getName());
            if (acuTableConf.getBoolean(Property.GC_TRASH_IGNORE) || !trash.moveToTrash(deleteFile))
              fs.delete(deleteFile, true);
          }
        }
       
        // atomically remove old files and add new file
View Full Code Here

Examples of org.apache.hadoop.fs.Trash.moveToTrash()

              log.error("rename is unsuccessful");
          } else {
            log.info("Deleting walog " + filename);
            Trash trash = new Trash(fs, fs.getConf());
            Path sourcePath = new Path(source);
            if (!(!acuConf.getBoolean(Property.GC_TRASH_IGNORE) && trash.moveToTrash(sourcePath)) && !fs.delete(sourcePath, true))
              log.warn("Failed to delete walog " + source);
            Path recoveryPath = new Path(Constants.getRecoveryDir(acuConf), filename);
            try {
              if (trash.moveToTrash(recoveryPath) || fs.delete(recoveryPath, true))
                log.info("Deleted any recovery log " + filename);
View Full Code Here

Examples of org.apache.hadoop.fs.Trash.moveToTrash()

            Path sourcePath = new Path(source);
            if (!(!acuConf.getBoolean(Property.GC_TRASH_IGNORE) && trash.moveToTrash(sourcePath)) && !fs.delete(sourcePath, true))
              log.warn("Failed to delete walog " + source);
            Path recoveryPath = new Path(Constants.getRecoveryDir(acuConf), filename);
            try {
              if (trash.moveToTrash(recoveryPath) || fs.delete(recoveryPath, true))
                log.info("Deleted any recovery log " + filename);
            } catch (FileNotFoundException ex) {
              // ignore
            }
           
View Full Code Here

Examples of org.apache.hadoop.fs.Trash.moveToTrash()

          // start deleting files, if we do not finish they will be cleaned
          // up later
          Trash trash = new Trash(fs, fs.getConf());
          for (Path path : oldDatafiles) {
            Path deleteFile = new Path(location + "/delete+" + compactName + "+" + path.getName());
            if (!trash.moveToTrash(deleteFile))
              fs.delete(deleteFile, true);
          }
        }
       
        // atomically remove old files and add new file
View Full Code Here

Examples of org.apache.hadoop.fs.Trash.moveToTrash()

              log.error("rename is unsuccessful");
          } else {
            log.info("Deleting walog " + filename);
            Trash trash = new Trash(fs, fs.getConf());
            Path sourcePath = new Path(source);
            if (!trash.moveToTrash(sourcePath) && !fs.delete(sourcePath, true))
              log.warn("Failed to delete walog " + source);
            Path recoveryPath = new Path(Constants.getRecoveryDir(acuConf), filename);
            try {
              if (trash.moveToTrash(recoveryPath) || fs.delete(recoveryPath, true))
                log.info("Deleted any recovery log " + filename);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.