2010-08-12 2 views
0

에서 사람 응용 프로그램 복사 파일을 가지고, 다음 코드는 일을하지 않습니다, 그것은 파일을 찾을 수 없습니다내가 웹 페이지에서 파일을 복사 할 수있는 응용 프로그램을 만든 웹 페이지

File ekstern = new File("http://192.168.13.40/cache.manifest"); 

copyFile(ekstern, intern); 

및 CopyFile 수 방법 :

public static void copyFile(File in, File out) throws IOException { 
     FileChannel inChannel = new 
      FileInputStream(in).getChannel(); 
     FileChannel outChannel = new 
      FileOutputStream(out).getChannel(); 
     try { 
      inChannel.transferTo(0, inChannel.size(), 
         outChannel); 
     } 
     catch (IOException e) { 
      throw e; 
     } 
     finally { 
      if (inChannel != null) inChannel.close(); 
      if (outChannel != null) outChannel.close(); 
     } 
    } 

그러나 코드는 파일이 없습니다 ekstern.exists()

테스트를 존재 않는 것을 말한다

답변

0

File 객체를 사용하여 웹 페이지에서 항목을 가져올 수 없습니다. HttpClient를 사용해야합니다.

+0

ok, 링크가 있습니까 ??? –

관련 문제