Package jnode.dto

Examples of jnode.dto.Filemail


   * @param attach
   * @param description
   */
  public static void hatchFile(Filearea area, File attach, String filename,
      String description) {
    Filemail mail = new Filemail();
    mail.setFilearea(area);
    mail.setFiledesc(description);
    mail.setFilename(filename);
    mail.setCreated(new Date());
    mail.setOrigin(getPrimaryFtnAddress().toString());
    mail.setPath("PATH " + getPrimaryFtnAddress().toString() + " "
        + (mail.getCreated().getTime() / 1000) + " "
        + mail.getCreated().toString() + "\r\n");
    mail.setSeenby("");
    String path = getFilePath(area.getName(), filename);
    File newFile = new File(path);
    if (FileUtils.move(attach, newFile, true)) {
      mail.setFilepath(newFile.getAbsolutePath());
    } else {
      mail.setFilepath(attach.getAbsolutePath());
      logger.l2("Failed to rename " + attach.getAbsolutePath() + " to "
          + path);
    }
    ORMManager.get(Filemail.class).save(mail);

View Full Code Here

TOP

Related Classes of jnode.dto.Filemail

Copyright © 2018 www.massapicom. 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.