Package com.knowgate.dfs

Examples of com.knowgate.dfs.FileSystem


    }     
  }
 
  public Volume setNewVolume(Dms oDms, String sVolumeName, String sVolumesMountBase, String sVolumeSubpath, String sRepositorySubpath, int iMaxDocSize, long lTotalSpace)
    throws FileNotFoundException, IOException, Exception {
    FileSystem oFs = new FileSystem();
    final String sRepositoryFullPath = Gadgets.chomp(sVolumesMountBase,File.separator)+sVolumeSubpath+File.separator+sRepositorySubpath;
    Log.out.debug("FileSystem.mkdirs(file://"+sRepositoryFullPath+")");
    oFs.mkdirs("file://"+sRepositoryFullPath);
    File oFl = new File(sRepositoryFullPath);
    if (!oFl.exists()) throw new FileNotFoundException("Could not create directory "+sRepositoryFullPath);
    VolumeManager oVolm = oDms.getVolumeManager();
    Log.out.debug("VolumeManager.createVolume("+sVolumeName+","+Gadgets.chomp(sVolumesMountBase,File.separator)+sVolumeSubpath+File.separator+","+sRepositorySubpath+","+String.valueOf(iMaxDocSize)+")");
    Volume oVol = oVolm.createVolume(sVolumeName, Gadgets.chomp(sVolumesMountBase,File.separator)+sVolumeSubpath+File.separator, sRepositorySubpath, iMaxDocSize);
View Full Code Here


    sUsrNick = sUserNickName;
    sUsrPwd = sUserPassword;
  }

  public void run() {
    FileSystem oFs = new FileSystem();
    HttpRequest oReq;
   
    try {
      AtrilSession oSes = DAO.getAdminSession("AsyncAccountCache");
      User oUsr = new User(oSes, User.forUuid(sUsrNick));
View Full Code Here

        bDefaultVolumeExists = v.name().equals("Default");
        if (bDefaultVolumeExists) break;
      }
      if (!bDefaultVolumeExists) {
        sMountBase = Gadgets.chomp(sMountBase, File.separator);
          FileSystem oFs = new FileSystem();
          try {
        oFs.mkdirs("file://"+sMountBase+"default");
      } catch (Exception e) {
        throw new FileNotFoundException("Could not create directory "+sMountBase+"default");
      }
          if (!new File(sMountBase).exists()) throw new FileNotFoundException("Could not create directory "+sMountBase+"default");
          Volume oVol = oVolm.createVolume("Default", sMountBase, "default", 20*1048576);
 
View Full Code Here

  // Add attachments to message to be sent

  if (aAttachmentsPath!=null) {
    final int nAttachments = aAttachmentsPath.length;

    FileSystem oFS = new FileSystem();
    for (int p=0; p<nAttachments; p++) {
      String sFilePath = aAttachmentsPath[p];
      if (sBasePath!=null) {
        if (!sFilePath.startsWith(sBasePath))
          sFilePath = sBasePath + sFilePath;
      }
      File oFile = new File(sFilePath);
     
      MimeBodyPart oAttachment = new MimeBodyPart();
      oAttachment.setDisposition("attachment");
      oAttachment.setFileName(oFile.getName());
      oAttachment.setHeader("Content-Transfer-Encoding", "base64");

      ByteArrayDataSource oDataSrc;
      try {
        oDataSrc = new ByteArrayDataSource(oFS.readfilebin(sFilePath), "application/octet-stream");
      } catch (com.enterprisedt.net.ftp.FTPException ftpe) {
      throw new IOException(ftpe.getMessage());
      }
      oAttachment.setDataHandler(new DataHandler(oDataSrc));
      oSentMsgParts.addBodyPart(oAttachment);
View Full Code Here

TOP

Related Classes of com.knowgate.dfs.FileSystem

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.