Logo Search packages:      
Sourcecode: jenkins-trilead-ssh2 version File versions  Download package

String com::trilead::ssh2::SFTPv3Client::readLink ( String  path ) throws IOException [inline]

Read the target of a symbolic link.

pathSee the comment for the class for more details.
The target of the link.

Definition at line 481 of file SFTPv3Client.java.

References receiveMessage().

            int req_id = generateNextRequestID();

            TypesWriter tw = new TypesWriter();
            tw.writeString(path, charsetName);

            if (debug != null)
                  debug.println("Sending SSH_FXP_READLINK...");

            sendMessage(Packet.SSH_FXP_READLINK, req_id, tw.getBytes());

            byte[] resp = receiveMessage(34000);

            if (debug != null)
                  debug.println("Got REPLY.");

            TypesReader tr = new TypesReader(resp);

            int t = tr.readByte();

            int rep_id = tr.readUINT32();
            if (rep_id != req_id)
                  throw new IOException("The server sent an invalid id field.");

            if (t == Packet.SSH_FXP_NAME)
                  int count = tr.readUINT32();

                  if (count != 1)
                        throw new IOException("The server sent an invalid SSH_FXP_NAME packet.");

                  return tr.readString(charsetName);

            if (t != Packet.SSH_FXP_STATUS)
                  throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

            int errorCode = tr.readUINT32();

            throw new SFTPException(tr.readString(), errorCode);

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index