code: public void setType(int type) throws IOException, ServerException {
  
          localServer.setTransferType(type);
  
          String typeStr = null;
          switch (type) {
          case Session.TYPE_IMAGE :
              typeStr = "I";
              break;
          case Session.TYPE_ASCII :
              typeStr = "A";
              break;
          case Session.TYPE_LOCAL :
              typeStr = "E";
              break;
          case Session.TYPE_EBCDIC :
              typeStr = "L";
              break;
          default :
              throw new IllegalArgumentException("Bad type: " + type);
          }
  
          Command cmd = new Command("TYPE", typeStr);
          try {
              controlChannel.execute(cmd);
          } catch (FTPReplyParseException rpe) {
              throw ServerException.embedFTPReplyParseException(rpe);
          } catch (UnexpectedReplyCodeException urce) {
              throw ServerException.embedUnexpectedReplyCodeException(
                                  urce,
                                  "Server refused changing transfer mode");
          }
  
          this.session.transferType = type;
      }
docs: Sets transfer type.
  @param type should be {@link Session#TYPE_IMAGE TYPE_IMAGE},
  {@link Session#TYPE_ASCII TYPE_ASCII},
  {@link Session#TYPE_LOCAL TYPE_LOCAL},
  {@link Session#TYPE_EBCDIC TYPE_EBCDIC}