file swing 강좌 - Java를 사용하여 온라인으로 mp3 파일을 다운로드하는 방법?
1
Answers
이클립스 디자인 윈도우빌더
나는 다음과 같은 방법으로 mp3 파일을 다운로드했다 : http://online1.tingclass.com/lesson/shi0529/43/32.mp3
하지만 다음 오류가 발생했습니다.
java.io.FileNotFoundException : http : \ online1.tingclass.com \ lesson \ shi0529 \ 43 \ 32.mp3 (파일 이름, 디렉토리 이름 또는 볼륨 레이블 구문이 올바르지 않음)
public static void Copy_File(String From_File,String To_File)
{
try
{
FileChannel sourceChannel=new FileInputStream(From_File).getChannel();
FileChannel destinationChannel=new FileOutputStream(To_File).getChannel();
sourceChannel.transferTo(0,sourceChannel.size(),destinationChannel);
// or
// destinationChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
sourceChannel.close();
destinationChannel.close();
}
catch (Exception e) { e.printStackTrace(); }
}
그러나 브라우저에서 직접 손으로 파일을 만들면 파일이있는 것입니다. 왜 작동하지 않는지 궁금합니다. 올바른 방법은 무엇입니까?
솔직한
0 votes
java