Package com.alibaba.jstorm.utils

Examples of com.alibaba.jstorm.utils.FileAttribute


      for (String fileName : files) {
        String logFile = Joiner.on(File.separator).join(path,
            fileName);

        FileAttribute fileAttribute = new FileAttribute();
        fileAttribute.setFileName(fileName);
       
        File subFile = new File(logFile);
       
        Date modify = new Date(subFile.lastModified());
        fileAttribute.setModifyTime(TimeFormat.getSecond(modify));

        if (subFile.isFile()) {
          fileAttribute.setIsDir(String.valueOf(false));
          fileAttribute.setSize(String.valueOf(subFile.length()));
         
         
          fileMap.put(logFile, fileAttribute);
        } else if (subFile.isDirectory()) {
          fileAttribute.setIsDir(String.valueOf(true));
          fileAttribute.setSize(String.valueOf(4096));
         
          fileMap.put(logFile, fileAttribute);
        }
       
       
View Full Code Here


  private void parseString(String input) {
    Map<String, Map> map = (Map<String, Map>) JStormUtils
        .from_json(input);

    for (Map jobj : map.values()) {
      FileAttribute attribute = FileAttribute.fromJSONObject(jobj);
      if (attribute != null) {

        if (JStormUtils.parseBoolean(attribute.getIsDir(), false) == true) {
          dirs.add(attribute);
        } else {
          files.add(attribute);
        }
View Full Code Here

TOP

Related Classes of com.alibaba.jstorm.utils.FileAttribute

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.