Examples of FileInfo


Examples of bg.smoc.model.serializer.FileInfo

            type = Task.TestType.valueOf(testType);
        } catch (IllegalArgumentException e) {
            response.sendRedirect("");
            return;
        }
        FileInfo fileInfo = contestManager.getTestDataFile(contestId,
                task.getName(),
                testNumber,
                type);
        if (fileInfo == null || fileInfo.getSize() > Integer.MAX_VALUE) {
            response.sendRedirect("");
            return;
        }

        response.setContentType("plain/text");
        response.setContentLength((int) fileInfo.getSize());
        response.setHeader("Content-Disposition", "attachment; filename=\""
                + new File(fileInfo.getAbsolutePath()).getName()
                + "\"");
       
        FileUtils.copyStreams(fileInfo.getInputStream(), response.getOutputStream());
        fileInfo.getInputStream().close();
    }
View Full Code Here

Examples of com.alibaba.otter.shared.etl.extend.fileresolver.FileInfo

        // 基本步骤:
        // 1. 获取binlog中的变更字段,比如组成文件有多个字段组成version+path
        // 2. 基于字段内容,构造一个文件路径,目前开源版本只支持本地文件的同步.(如果是网络文件,建议进行NFS mount到ndde机器).
        // 3. 返回FileInfo数组,(目前不支持目录同步,如果是目录需要展开为多个FileInfo的子文件),如果不需要同步,则返回null.
        String path = rowMap.get("FIELD"); //注意为大写
        FileInfo fileInfo = null;
        if (StringUtils.isNotEmpty(path)) {
            fileInfo = new FileInfo(path);
            return new FileInfo[] { fileInfo };
        } else {
            return null;
        }
    }
View Full Code Here

Examples of com.englishtown.vertx.cassandra.binarystore.FileInfo

        if (obj == null) return false;
        if (obj == this) return true;

        if (!(obj instanceof FileInfo)) return false;

        FileInfo other = (FileInfo) obj;

        if (!Objects.equals(this.getId(), other.getId())) return false;
        if (!Objects.equals(this.getFileName(), other.getFileName())) return false;
        if (!Objects.equals(this.getContentType(), other.getContentType())) return false;
        if (!Objects.equals(this.getLength(), other.getLength())) return false;
        if (!Objects.equals(this.getChunkSize(), other.getChunkSize())) return false;
        if (!Objects.equals(this.getUploadDate(), other.getUploadDate())) return false;

        return true;
    }
View Full Code Here

Examples of com.google.appengine.api.blobstore.FileInfo

    protected final Logger log = Logger.getLogger(getClass().getName());

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        BlobstoreService blobstore = BlobstoreServiceFactory.getBlobstoreService();
        FileInfo info = UploadHandlerServlet.getFirst(blobstore.getFileInfos(request), false);
        String gsObjectName = info.getGsObjectName();
        String uploadedFilename = info.getFilename();

        if (!uploadedFilename.equals(request.getParameter("uploadedFilename"))) {
            throw new IllegalStateException("Uploaded filename is incorrect: expecting " + request.getParameter("uploadedFilename") + " but got " + uploadedFilename);
        }
View Full Code Here

Examples of com.google.collide.dto.FileInfo

      transformImpl(childDir);
    }

    JsonArray<FileInfo> files = node.getFiles();
    for (int i = 0, n = files.size(); i < n; i++) {
      FileInfo childFile = files.get(i);
      installBackRef(node, childFile);
    }
  }
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

   * update the testcase with.
   */
  private List<FileInfo> updateCache(List<FileInfo> newFiles) {
    List<FileInfo> replace = Lists.newArrayList();
    for (FileInfo file : newFiles) {
      FileInfo oldFile = files.getFile(file.getDisplayPath());
      if (oldFile == null) {
        files.addFile(file);
        logger.debug("adding {}", file.getDisplayPath());
      } else if (oldFile.shouldReplaceWith(file)) {
        logger.debug("replacing {}", oldFile.getDisplayPath());
        files.addFile(file);
      } else if (file.isLoaded()) {
        logger.debug("updating {} (loaded)", file.getDisplayPath());
        files.addFile(file);
      } else if (oldFile.isLoaded() && !file.isLoaded()){
        logger.debug("not replacing {}", file.getDisplayPath());
        // the old file the same as the new, except the old is loaded.
        replace.add(oldFile);
      } else {
        logger.debug("files are equal {}", file.getDisplayPath());
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

        new PathResolver(tmpDirs,
            Sets.<FileParsePostProcessor>newHashSet(new FileParsePostProcessor(){
              public Set<FileInfo> process(Set<FileInfo> files) {
                Set<FileInfo> processed = Sets.newHashSet();
                for (FileInfo fileInfo : files) {
                  processed.add(new FileInfo(fileInfo.getFilePath(),
                      code.lastModified(), -1, false, true, null, fileInfo.getDisplayPath()));
                }
                return processed;
              }
            }), new DisplayPathSanitizer()), createFlags());
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

   
    doScriptTest(script);
  }

  private void doScriptTest(ScriptBuilder script) {
    FileInfo test = new FileInfo("foo.js", 20, -1, false, false, script.buildTest(), "foo.js");
    FileInfo expected = new FileInfo(test.getFilePath(),
                                     test.getTimestamp(),
                                     -1,
                                     test.isPatch(),
                                     test.isServeOnly(),
                                     script.buildExpect(),
                                     test.getDisplayPath());
    FileInfo actual = new InlineHtmlProcessor(new HtmlDocParser(),
        new HtmlDocLexer()).process(test);
    assertEquals(expected.getFilePath(), actual.getFilePath());
    assertEquals(expected.getTimestamp(), actual.getTimestamp());
    assertEquals(expected.isPatch(), actual.isPatch());
    assertEquals(expected.isServeOnly(), actual.isServeOnly());
    assertEquals(expected.getData(), actual.getData());
  }
View Full Code Here

Examples of com.google.jstestdriver.FileInfo

    assertEquals(
        new JstdTestCase(DEPS_2, Lists.newArrayList(TEST_3), PLUGINS_2, ""), processedTests.get(2));
  }
 
  private static FileInfo getFileInfo(String name) {
    return new FileInfo(name, 0, 0, false, false, "", "");
  }
View Full Code Here

Examples of com.google.jstestdriver.FileInfo


    JstdTestCaseStore store = new JstdTestCaseStore();
    store.addCase(new JstdTestCase(
        Lists.newArrayList(
            new FileInfo("dummy.js", -1, -1, false, false, "data", "dummy.js"),
            new FileInfo("dummytoo.js", 20, -1, false, false, "more data", "dummytoo.js")),
        Collections.<FileInfo>emptyList(),
        Collections.<FileInfo>emptyList(),
            "id"));
    TestResourceHandler handler =
        new TestResourceHandler(null, response, store);
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.