1 16 package org.apache.commons.vfs.test; 17 18 import org.apache.commons.vfs.Capability; 19 import org.apache.commons.vfs.FileObject; 20 import org.apache.commons.vfs.provider.http.HttpFileSystem; 21 22 import java.io.IOException ; 23 24 29 public class UrlStructureTests 30 extends AbstractProviderTestCase 31 { 32 35 protected Capability[] getRequiredCaps() 36 { 37 return new Capability[] 38 { 39 Capability.GET_TYPE, 40 Capability.URI 41 }; 42 } 43 44 47 public void testFolderURL() throws Exception 48 { 49 final FileObject folder = getReadFolder().resolveFile("dir1"); 50 if (folder.getFileSystem() instanceof HttpFileSystem) 51 { 52 return; 55 } 56 57 assertTrue(folder.exists()); 58 59 try 61 { 62 folder.getURL().openConnection().getInputStream(); 63 fail(); 64 } 65 catch (final IOException e) 66 { 67 assertSameMessage("vfs.provider/read-not-file.error", folder, e); 68 } 69 } 70 } 71 | Popular Tags |