Package org.cfeclipse.cfml.net

Examples of org.cfeclipse.cfml.net.RemoteFile


      public void doubleClick(DoubleClickEvent event) {
        ISelection selection = event.getSelection();
        TreeSelection sel = (TreeSelection)event.getSelection();
        Object firstElement = sel.getFirstElement();
        if (firstElement instanceof RemoteFile) {
          RemoteFile remFile = (RemoteFile) firstElement;
          String absolutePath = remFile.getAbsolutePath();
         
          StructuredSelection selection2 = (StructuredSelection)comboViewer.getSelection();
         
          if (selection2.getFirstElement() instanceof FTPConnection) {
            FTPConnection ftpConn = (FTPConnection) selection2.getFirstElement();
View Full Code Here


                }
              }             
            }
          }
          else if(obj instanceof RemoteFile){
            RemoteFile rem = (RemoteFile)obj;
            try {
              FileObject object2 = rem.getFileItem().resolveFile(fcd.filename);
              if(object2.getType().equals(FileType.IMAGINARY)){
                object2.createFolder();
                directoryTreeViewer.refresh(obj);
              }
            } catch (FileSystemException e1) {
View Full Code Here

               * resulting array.
               */
              ArrayList<RemoteFile> filteredFileList = new ArrayList<RemoteFile>();
              for (int i = 0; i < files.length; i++) {
                 if (filter.accept(files[i])) {
                   RemoteFile file = new RemoteFile(files[i], files[i].getURL().toString());
                     filteredFileList.add(file);
                  }
              }

              return filteredFileList.toArray();
View Full Code Here

                return null;
            }

            FileObject selFile = FTPConnection.manager.resolveFile(filename);
           // FTPFile[] files = ftpClient.dirDetails(filename);
            RemoteFile remoteFile = new RemoteFile(selFile, filename);
               RemoteFileEditorInput input = new RemoteFileEditorInput(remoteFile);
            return input;
        } catch (Exception e) {
            AlertUtils.alertUser(e);
            return null;
View Full Code Here

    private Image addPermissionIcon(Object element, Image image) {

        boolean canRead = true;
        boolean canWrite = true;
        if (element instanceof RemoteFile) {
            RemoteFile file = (RemoteFile)element;
            canRead = file.canRead();
            canWrite = file.canWrite();
        }
        else if (element instanceof File) {
            File file = (File)element;
            canRead = file.canRead();
            canWrite = file.canWrite();
        }
        else {
            return image;
        }
       
View Full Code Here

      Object[] element = (Object[])ss.getFirstElement();
      IEditorInput input = contentProvider.getEditorInput(element[0].toString());
     
      String fileName = "";
      if (element[0] instanceof RemoteFile) {
      RemoteFile remFile = (RemoteFile) element[0];
      fileName = remFile.getName();
      input = new RemoteFileEditorInput(remFile);
    }
     
     
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
View Full Code Here

        //int redPixel = image.getImageData().palette.getPixel(new RGB(255,0,0));
        //int greenPixel = image.getImageData().palette.getPixel(new RGB(0,255,0));
        boolean canRead = true;
        boolean canWrite = true;
        if (element instanceof RemoteFile) {
            RemoteFile file = (RemoteFile)element;
            canRead = file.canRead();
            canWrite = file.canWrite();
        }
        else if (element instanceof File) {
            File file = (File)element;
            canRead = file.canRead();
            canWrite = file.canWrite();
        }
        else {
            return image;
        }
       
View Full Code Here

              if (inputElement instanceof TreeSelection) {
          TreeSelection selection = (TreeSelection) inputElement;
          Object firstElement = selection.getFirstElement();
         
          if (firstElement instanceof RemoteFile) {
            RemoteFile remFile = (RemoteFile) firstElement;
            if(remFile != null){
             directoryName = remFile.getFileItem().getName().getPath();
            }
           
          }
         
         
         
        }
           
              //System.out.println("Getting children of  " + inputElement.getClass().getName());
              //TODO: Need to return another array as the files... so its an array of name + Size
             
             
              Object[] files = fileProvider.getChildren(directoryName,fileFilter);
             
              //add another column?
              Object[] retFiles = new Object[files.length];
             
              for (int i = 0; i < files.length; i++) {
                Object[] retFile = new Object[2];
                retFile[0] = files[i];
               
                if(files[i] instanceof File){
                  File itemFile = (File)files[i];
                  retFile[1] = itemFile.length()/1024 + " KB";
                }
                else if(files[i] instanceof RemoteFile){
                  RemoteFile itemFile = (RemoteFile)files[i];
                  retFile[1] = itemFile.size()/1024 + " KB";
                }
                else {
                  retFile[1] = "???";
                }
                retFiles[i] = retFile;
View Full Code Here

            results =  fileProvider.getRoots();
           
          } else if (parentElement instanceof RemoteFile) {
           
           
              RemoteFile file = (RemoteFile)parentElement;
              String name = file.getFileItem().getName().getPath();
              results = fileProvider.getChildren(name,directoryFilter);
             
          } else if (parentElement instanceof FileSystemRoot) {

            FileSystemRoot file = (FileSystemRoot)parentElement;
              results =  fileProvider.getChildren(file.getPath(),directoryFilter);
          }
         
          else {
           
                results = fileProvider.getChildren(parentElement.toString(),directoryFilter);
View Full Code Here

TOP

Related Classes of org.cfeclipse.cfml.net.RemoteFile

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.