Examples of SFTPv3DirectoryEntry


Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

    } else if (es == openProject) {
      if (selectedNode instanceof RemoteProjectMutuableTreeNode) {
        RemoteProjectMutuableTreeNode rNode = (RemoteProjectMutuableTreeNode) selectedNode;
        RemoteProject rProject = rNode.getRemoteProject();
        JSimLogic.getInstance().openConnection(rProject);
        SFTPv3DirectoryEntry entry = JSimLogic.getInstance()
            .getDirectoryEntry(rProject,
                rProject.getPath() + rProject.getName());
        if (entry != null) {
          rNode.setJSimNode(entry);
          rNode.createNodes(true);
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

   * (non-Javadoc)
   *
   * @see javax.swing.ListModel#getElementAt(int)
   */
  public Object getElementAt(int index) {
    SFTPv3DirectoryEntry entry = files.get(index);
    return entry.filename;
  }
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

    files.addElement(entry);
    fireIntervalAdded(this, index, index);
  }
 
  public boolean isElementDirectory(int index){
    SFTPv3DirectoryEntry entry = files.get(index);
    return entry.attributes.isDirectory();
  }
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

   * @return SFTPv3DirectoryEntry
   * @throws IOException
   */
  public SFTPv3DirectoryEntry getDirectoryEntry(String path)
      throws IOException {
    SFTPv3DirectoryEntry entry = new SFTPv3DirectoryEntry();
    SFTPv3Client sftpConn = null;
    try {
      sftpConn = new SFTPv3Client(conn);
      SFTPv3FileAttributes attribute = sftpConn.lstat(path);
      entry.attributes = attribute;
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

   * @param nodes
   */
  private void filterNodes(Vector<SFTPv3DirectoryEntry> nodes) {
    for (Iterator<SFTPv3DirectoryEntry> iterator = nodes.iterator(); iterator
        .hasNext();) {
      SFTPv3DirectoryEntry directoryEntry = iterator.next();
      if (directoryEntry.filename
          .equals(JSimConstants.DEFAULTDIRECTORY_1)
          || directoryEntry.filename
              .equals(JSimConstants.DEFAULTDIRECTORY_2))
        iterator.remove();
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

   */
  public void delete(String pathString) throws IOException {
    SFTPv3Client sftpConn = null;
    try {
      sftpConn = new SFTPv3Client(conn);
      SFTPv3DirectoryEntry dirEntry = getDirectoryEntry(pathString);
      if (dirEntry.attributes.isDirectory()) {
        deleteDirectory(sftpConn, dirEntry, pathString);
      } else
        sftpConn.rm(pathString);
    } catch (IOException e) {
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

   * @see jSimMacs.logic.location.DataHandler#readFile(java.lang.String)
   */
  public File readFile(String pathString) throws IOException {
    File file = null;
    SCPClient scpClient = null;
    SFTPv3DirectoryEntry dirEntry = null;
    boolean noFile = false;
    try {
      dirEntry = getDirectoryEntry(pathString);
    } catch (IOException e) {
      if (e instanceof SFTPException) {
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

   * @param path where to copy file
   * @throws IOException
   */
  public void copyToServer(File file, String path) throws IOException {
    String serverPath = path;
    SFTPv3DirectoryEntry pathEntry = getDirectoryEntry(path);
    if (pathEntry.attributes.isRegularFile())
      serverPath = serverPath.substring(0, serverPath.lastIndexOf("/"));
    SCPClient scpClient = new SCPClient(conn);
    scpClient.put(file.getPath(), serverPath, standardFilePermission);
  }
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

   * @throws IOException
   */
  public void copy(String source, String destination) throws IOException {
    Session sess = createSession();
    String serverDestPath = destination;
    SFTPv3DirectoryEntry pathEntry = getDirectoryEntry(destination);
    if (pathEntry.attributes.isRegularFile())
      serverDestPath = serverDestPath.substring(0, serverDestPath
          .lastIndexOf("/"));

    SFTPv3DirectoryEntry pathEntrySource = getDirectoryEntry(source);
    if (pathEntrySource.attributes.isDirectory())
      return;

    String copyCommand = JSimConstants.COPYSSH;
    copyCommand = copyCommand.replace("%1", source);
View Full Code Here

Examples of com.trilead.ssh2.SFTPv3DirectoryEntry

   */
  public void deleteBackup(String pathString) throws IOException {
    SFTPv3Client sftpConn = null;
    try {
      sftpConn = new SFTPv3Client(conn);
      SFTPv3DirectoryEntry dirEntry = getDirectoryEntry(pathString);
      if (dirEntry.attributes.isDirectory()) {
        deleteBackupDirectory(sftpConn, dirEntry, pathString);
      } else if (dirEntry.filename.startsWith("#")
          && dirEntry.filename.endsWith("#"))
        sftpConn.rm(pathString);
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.