110.12. 단계별로 디렉터리 변경
Camel FTP는 파일 사용(예: 다운로드) 또는 파일 생성(예: 업로드)을 수행할 때 traversing 디렉토리 측면에서 두 가지 모드로 작동할 수 있습니다.
- stepwise
- 단계적이 아닙니다.
문제 및 보안 문제에 따라 하나를 선택할 수 있습니다. 일부 Camel 최종 사용자는 stepwise를 사용하는 경우에만 파일을 다운로드할 수 있으며, 다른 사용자는 다운로드할 수 없는 경우에만 다운로드할 수 있습니다. 최소 Camel 2.6 이후 선택할 수 있습니다.
Camel 2.0 - 2.5에는 다음과 같은 모드가 하나만 있습니다.
- 2.5이 아닌 경우
- 2.5 stepwise
Camel 2.6 이후부터는 동작을 제어하는 데 사용할 수 있는 옵션 단계 가 있습니다.
디렉토리를 단계별로 변경하는 것은 대부분의 경우 사용자가 홈 디렉토리로 제한되고 홈 디렉터리가 "/"로 보고될 때만 작동합니다.
둘 사이의 차이점은 예시와 함께 가장 잘 설명되어 있습니다. 원격 FTP 서버에 다음 디렉터리 구조가 있다고 가정합니다. 파일을 트래버스하고 다운로드해야 합니다.
/ /one /one/two /one/two/sub-a /one/two/sub-b
그리고 각각의 하위-a(a.txt) 및 sub-b(b.txt) 폴더에 파일이 있습니다.
110.12.1. stepwise=true(기본 모드) 사용
TYPE A 200 Type set to A PWD 257 "/" is current directory. CWD one 250 CWD successful. "/one" is current directory. CWD two 250 CWD successful. "/one/two" is current directory. SYST 215 UNIX emulated by FileZilla PORT 127,0,0,1,17,94 200 Port command successful LIST 150 Opening data channel for directory list. 226 Transfer OK CWD sub-a 250 CWD successful. "/one/two/sub-a" is current directory. PORT 127,0,0,1,17,95 200 Port command successful LIST 150 Opening data channel for directory list. 226 Transfer OK CDUP 200 CDUP successful. "/one/two" is current directory. CWD sub-b 250 CWD successful. "/one/two/sub-b" is current directory. PORT 127,0,0,1,17,96 200 Port command successful LIST 150 Opening data channel for directory list. 226 Transfer OK CDUP 200 CDUP successful. "/one/two" is current directory. CWD / 250 CWD successful. "/" is current directory. PWD 257 "/" is current directory. CWD one 250 CWD successful. "/one" is current directory. CWD two 250 CWD successful. "/one/two" is current directory. PORT 127,0,0,1,17,97 200 Port command successful RETR foo.txt 150 Opening data channel for file transfer. 226 Transfer OK CWD / 250 CWD successful. "/" is current directory. PWD 257 "/" is current directory. CWD one 250 CWD successful. "/one" is current directory. CWD two 250 CWD successful. "/one/two" is current directory. CWD sub-a 250 CWD successful. "/one/two/sub-a" is current directory. PORT 127,0,0,1,17,98 200 Port command successful RETR a.txt 150 Opening data channel for file transfer. 226 Transfer OK CWD / 250 CWD successful. "/" is current directory. PWD 257 "/" is current directory. CWD one 250 CWD successful. "/one" is current directory. CWD two 250 CWD successful. "/one/two" is current directory. CWD sub-b 250 CWD successful. "/one/two/sub-b" is current directory. PORT 127,0,0,1,17,99 200 Port command successful RETR b.txt 150 Opening data channel for file transfer. 226 Transfer OK CWD / 250 CWD successful. "/" is current directory. QUIT 221 Goodbye disconnected.
단계별가 활성화되어 있는 경우를 볼 수 있듯이 CD xxx를 사용하여 디렉터리 구조를 이동합니다.