Ejemplo n.º 1
0
    public void processFile(ContentItem inContent, User inUser) throws OpenEditException {
      String path = inContent.getPath();
      // if (inContent instanceof FileItem)
      // {
      // String abs = ((FileItem) inContent).getAbsolutePath();
      // if (getRoot() != null)
      // {
      // String root = getRoot().getAbsolutePath();
      // if (abs.contains(getRoot().getAbsolutePath()))
      // {
      // path = abs.substring(root.length());
      // }
      // }
      // }

      // The zip entry can't begin with any slashes
      while (path.startsWith("/")) {
        path = path.substring(1, path.length());
      }

      try {
        addTozip(inContent, path, zipOutputStream);
      } catch (Exception e) {
        if (e.getMessage().startsWith("duplicate")) {
          return;
        }
        throw new OpenEditException(e);
      }
    }
Ejemplo n.º 2
0
    public boolean acceptFile(ContentItem inFileItem) {
      String openeditpath = inFileItem.getPath(); // .replace('\\', '/');
      // // Windows
      // replace
      if (inFileItem.isFolder() && !openeditpath.endsWith("/")) {
        openeditpath = openeditpath + "/"; // Make sure we leave the /
        // on there for directories
      }

      return isValidEntry(openeditpath);
    }