1 package de.jwi.jgallery; 2 3 24 25 26 import java.io.BufferedReader ; 27 import java.io.IOException ; 28 import java.io.InputStream ; 29 import java.io.InputStreamReader ; 30 import java.util.ArrayList ; 31 import java.util.List ; 32 33 import javax.servlet.ServletContext ; 34 35 36 37 42 public class WebFolder extends Folder 43 { 44 private String baseURL; 45 private String remoteKey; 46 47 public WebFolder(String baseURL, ServletContext appContext, Configuration configuration, ConfigData configData, String remoteKey, String jgalleryContextPath, 48 String folderPath, InputStream fileList) throws GalleryException 49 { 50 super(null, appContext, configuration,configData, jgalleryContextPath,folderPath,folderPath,null); 51 this.baseURL = baseURL; 52 this.remoteKey = remoteKey; 53 54 List images = new ArrayList (); 55 56 BufferedReader in 57 = new BufferedReader (new InputStreamReader (fileList)); 58 59 String s; 60 61 try 62 { 63 while ((s=in.readLine())!=null) 64 { 65 images.add(s); 66 } 67 } 68 catch (IOException e) 69 { 70 throw new GalleryException(e.getMessage()); 71 } 72 73 imageFiles = (String [])images.toArray(new String [0]); 74 75 endLoad(); 76 } 77 78 protected IImageAccessor makeImageAccessor(String name) 79 { 80 return new WebImageAccessor(name, this); 81 } 82 83 public void loadFolder() 84 { 85 87 } 88 89 protected String [] getSubDirectories() 90 { 91 return new String [0]; 92 } 93 94 public String getBaseURL() 95 { 96 return baseURL; 97 } 98 99 public String getFolderPath() 100 { 101 return baseURL + folderPath; 102 } 103 104 public String getThumbsPath() 105 { 106 return baseURL + super.getThumbsPath(); 107 } 108 109 public String getHTMLBase() 110 { 111 return jgalleryContextPath + "/" + remoteKey + folderPath; 112 } 113 114 115 } 116 | Popular Tags |