24.16. 완료된 파일 작성
파일을 작성한 후에는 한 종류의 마커로 추가 완료파일을 작성하여 파일이 완료되어 작성되었음을 다른 사용자에게 표시할 수 있습니다. 이를 위해 파일 프로듀서 엔드포인트에서 doneFileName
옵션을 사용할 수 있습니다.
.to("file:bar?doneFileName=done");
.to("file:bar?doneFileName=done");
은 대상 파일과 동일한 디렉터리에서 done
이라는 파일을 생성할 수 있습니다.
그러나 대상 파일당 하나의 수행 파일이 있는 것이 더 일반적입니다. 즉, 1:1 상관 관계가 있습니다. 이렇게 하려면 doneFileName
옵션에서 동적 자리 표시자를 사용해야 합니다. 현재 Camel은 다음 두 가지 동적 토큰을 지원합니다. file:name
및 file:name.noext
는 $\{ }로 묶어야 합니다.
.to("file:bar?doneFileName=done-${file:name}");
.to("file:bar?doneFileName=done-${file:name}");
예를 들어 대상 파일이 대상 파일과 동일한 디렉토리에 foo.txt
인 경우 done-foo.txt
라는 파일을 생성합니다.
.to("file:bar?doneFileName=${file:name}.done");
.to("file:bar?doneFileName=${file:name}.done");
예를 들어 대상 파일이 대상 파일과 동일한 디렉터리에 foo.txt.done
인 경우 파일 foo.txt
를 생성합니다.
.to("file:bar?doneFileName=${file:name.noext}.done");
.to("file:bar?doneFileName=${file:name.noext}.done");
예를 들어 대상 파일이 대상 파일과 동일한 디렉터리에 foo.done
인 경우 foo.
done이라는 파일을 생성합니다.