Package se.runa.clipboard

Examples of se.runa.clipboard.ClipboardManager$FileContent


                    : VFS.getManager().resolveFile(url.toString(), opts);
            if (file.getType() != FileType.FILE)
            {
                throw new ConfigurationException("Cannot load a configuration from a directory");
            }
            FileContent content = file.getContent();
            if (content == null)
            {
                String msg = "Cannot access content of " + file.getName().getFriendlyURI();
                throw new ConfigurationException(msg);
            }
            return content.getInputStream();
        }
        catch (FileSystemException fse)
        {
            String msg = "Unable to access " + url.toString();
            throw new ConfigurationException(msg, fse);
View Full Code Here


            // throw an exception if the target URL is a directory
            if (file == null || file.getType() == FileType.FOLDER)
            {
                throw new ConfigurationException("Cannot save a configuration to a directory");
            }
            FileContent content = file.getContent();

            if (content == null)
            {
                throw new ConfigurationException("Cannot access content of " + url);
            }
            return content.getOutputStream();
        }
        catch (FileSystemException fse)
        {
            throw new ConfigurationException("Unable to access " + url, fse);
        }
View Full Code Here

     * Finds the provider to use to create a filesystem from a given file.
     */
    public String getScheme(final FileObject file) throws FileSystemException
    {
        // Check the file's mime type for a match
        final FileContent content = file.getContent();
        final String mimeType = content.getContentInfo().getContentType();
        if (mimeType != null)
        {
            return mimeTypeMap.get(mimeType);
        }

View Full Code Here

      item.setText(0, data.getName().getBaseName());
      String type = data.getType().getName(); //FIXME: translate type name {file,folder}

      if (data.getType().hasContent()) {
        FileContent content = data.getContent();
        String contentType = content.getContentInfo().getContentType();
        if (contentType != null) {
          type += " (" + contentType + ")";
        }
        item.setText(1, String.valueOf(content.getSize()));
        item.setText(3, df.format(new Date(content.getLastModifiedTime())));
      }
      else {
        item.setText(1, "");
        item.setText(3, "");
      }
View Full Code Here

  private File buildNode(final File parent, final FileObject file) throws FileSystemException {
    String name = file.getName().getBaseName();

    File n = new AbstractFile(this, name, parent, file.getType() == FileType.FOLDER, true);
    if (file.getType() == FileType.FILE) {
      FileContent content = file.getContent();
      n.setLastModified(content.getLastModifiedTime());
      n.setSize(content.getSize());
    }
    return n;
  }
View Full Code Here

  }

  @Override
  public final boolean writeFileAttributes(final File file) throws IOException {
    FileObject obj = base.resolveFile(file.getPath());
    FileContent content = obj.getContent();
    content.setLastModifiedTime(file.getLastModified());
    return true;
  }
View Full Code Here

        if (file.exists())
        {
            final String newPrefix = prefix + INDENT;
            if (file.getType().hasContent())
            {
                final FileContent content = file.getContent();
                log(newPrefix + "Content-Length: " + content.getSize());
                log(newPrefix + "Last-Modified" + new Date(content.getLastModifiedTime()));
                if (showContent)
                {
                    log(newPrefix + "Content:");
                    logContent(file, newPrefix);
                }
View Full Code Here

  }
    }

    void paste() {
  try {
      ClipboardManager manager = ClipboardManager.instance();
      List<File> files = manager.getFileContent();
      ClipboardStrategy strategy = manager.getStrategyContent();
      if (files == null || files.isEmpty()) {
    Toolkit.getDefaultToolkit().beep();
      } else {
    File destDir = getSelectedTreeNode();
    new PasteDialog(this, files, destDir, strategy);
View Full Code Here

TOP

Related Classes of se.runa.clipboard.ClipboardManager$FileContent

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.