너무너무너무 신기하다!!!!!
이렇게 !!!!! 파일이 짠 생긴것을 알수있다!!!!!transferTo
void transferTo(File dest) throws IOException, IllegalStateException
Transfer the received file to the given destination file.This may either move the file in the filesystem, copy the file in the filesystem, or save memory-held contents to the destination file. If the destination file already exists, it will be deleted first.
If the target file has been moved in the filesystem, this operation cannot be invoked again afterwards. Therefore, call this method just once in order to work with any storage mechanism.
NOTE: Depending on the underlying provider, temporary storage may be container-dependent, including the base directory for relative destinations specified here (e.g. with Servlet 3.0 multipart handling). For absolute destinations, the target file may get renamed/moved from its temporary location or newly copied, even if a temporary copy already exists.
- Parameters:
dest
- the destination file (typically absolute)- Throws:
IOException
- in case of reading or writing errorsIllegalStateException
- if the file has already been moved in the filesystem and is not available anymore for another transfer- See Also:
FileItem.write(File)
,Part.write(String)
transferTo
default void transferTo(Path dest) throws IOException, IllegalStateException
Transfer the received file to the given destination file.The default implementation simply copies the file input stream.
- Throws:
IOException
IllegalStateException
- Since:
- 5.1
- See Also:
getInputStream()
,transferTo(File)
너무너무 신기하다.
최근 OS에 대한 강의를 유투브에서 들었다.
file을 다룬다는 것 => OS가 interface역할을 통해 커널의 기능을 손쉽게 이용할 수 있게 해준다. 우리는 직접 커널을 호출해서 파일기능을 수행할 수도 있고. OS가 제공하는 함수들을 통해 파일관련 다룰수도 있게 된다. 내가 직접 파일을 만들고 읽고 send하고.. 이런 함수들을 개별적으로 부르지 않아도 된다! 그리고 이러한 OS가 제공하는 함수들을 -> spring이 또 한번 감싸서! 더더 쉽게 file을 다룰 수 있게 되는 것이다.
system.out.printf 같은 함수들- 의 system 이란 os였던 것이다. OS가 커널과 유저사이의 interface역할로서 둘을 연결시켜주기때문에 - 내가 커널의 기능을 직접 이용하는 함수를 구현하지않아도. 단순히 함수를 호출하는 것으로 편리하게 기능을 사용할 수 있게 된다.
너무 당연하게 system의 기능을 사용하면서도 몰랐던 것이다!!! 놀라움 놀라움.
댓글 없음:
댓글 쓰기