Package com.adito.networkplaces.model

Examples of com.adito.networkplaces.model.FileSystemItem


        try {
          ft = element.getFile().getType();
        } catch (FileSystemException e) {
        } catch (IOException e) {
        }
        FileSystemItem item = null;
        if (ft != null && element.getFile().getType().equals(FileType.FOLDER)
          && fileSystemForm.getNetworkPlace().isAllowRecursive()) {
          // if it is a folder
                    if(element.getLastModified() != null)
                        gc.setTime(element.getLastModified());
          item = new FolderItem(fileSystemForm.getLaunchSession(), element.getDisplayName(), res.getMount()
                  .getStore()
                  .getName(), fileSystemForm.getPath(), gc, element.getFile().getType().getName(), false, i);
        } else if (ft != null && element.getFile().getType().equals(FileType.FILE)) {
          // if it is a file
                    if(element.getLastModified() != null)
                        gc.setTime(element.getLastModified());
          item = new FileItem(fileSystemForm.getLaunchSession(), element.getDisplayName(), element.getContentLength()
                  .longValue(), gc, element.getFile().getType().getName(), false, i);
        } else {
          if (log.isInfoEnabled())
            log.info("Unable to display file " + element.getDisplayName() + " as it is an imaginary file.");
          warnings.add(Constants.REQ_ATTR_WARNINGS, new BundleActionMessage(NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
                  "vfs.imaginary.file",
                  element.getDisplayName()));

          // decrement the counter as there is no file added.
          i--;
        }
        if (item != null) {
          allFileSystemItems.add(item);
          if (request.getParameter("select" + Util.urlEncode(item.getFileName())) != null) {
            item.setChecked(true);
          }
        }
      }
      if (fileSystemForm.getPaths() == null || fileSystemForm.getPaths().isEmpty()) {
        fileSystemForm.setHome(fileSystemForm.getPath());
View Full Code Here


     * @return Object[] of the selected resources.
     */
    public String[] getSelectedFileNames() {
        List selected = new ArrayList();
        for (Iterator i = getModel().getItems().iterator(); i.hasNext();) {
            FileSystemItem ti = (FileSystemItem) i.next();
            if (ti.getChecked())
                selected.add(ti.getFileName());
        }
        return (String[]) selected.toArray(new String[selected.size()]);
    }
View Full Code Here

        try {
            Iterator i = allFileSystemItems.iterator();

            while (i.hasNext()) {
                FileSystemItem it = (FileSystemItem) i.next();
                it.setSortFoldersFirst(true);
                getModel().addItem(it);
            }
            getPager().setSortReverse(getSortReverse());
            getPager().rebuild(getFilterText());
        } catch (Throwable t) {
View Full Code Here

TOP

Related Classes of com.adito.networkplaces.model.FileSystemItem

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.