Author: mreutegg Date: Fri Feb 6 10:48:56 2009 New Revision: 741524 URL: http://svn.apache.org/viewvc?rev=741524&view=rev Log: JCR-1970: populate.jsp uses Java 1.5 method Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/populate.jsp Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/populate.jsp URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/populate.jsp?rev=741524&r1=741523&r2=741524&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/populate.jsp (original) +++ jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/populate.jsp Fri Feb 6 10:48:56 2009 @@ -13,30 +13,30 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ---%><%@ page import="org.apache.jackrabbit.j2ee.RepositoryAccessServlet, - org.apache.jackrabbit.util.Text, - javax.jcr.Node, - javax.jcr.Repository, - javax.jcr.Session, - javax.jcr.SimpleCredentials, - javax.swing.text.AttributeSet, - javax.swing.text.html.HTML, - javax.swing.text.html.HTMLDocument, - javax.swing.text.html.HTMLEditorKit, - java.io.FilterInputStream, - java.io.IOException, - java.io.InputStream, - java.io.InputStreamReader, - java.net.URL, - java.net.URLConnection, - java.net.URLDecoder, - java.net.URLEncoder, - java.util.ArrayList, - java.util.Arrays, - java.util.Calendar, - java.util.Collections, - java.util.Iterator, - java.util.List" +--%><%@ page import="java.io.FilterInputStream, + java.io.IOException, + java.io.InputStream, + java.io.InputStreamReader, + java.net.URL, + java.net.URLConnection, + java.net.URLDecoder, + java.net.URLEncoder, + java.util.ArrayList, + java.util.Arrays, + java.util.Calendar, + java.util.Collections, + java.util.Iterator, + java.util.List, + javax.jcr.Node, + javax.jcr.Repository, + javax.jcr.Session, + javax.jcr.SimpleCredentials, + javax.swing.text.AttributeSet, + javax.swing.text.html.HTML, + javax.swing.text.html.HTMLDocument, + javax.swing.text.html.HTMLEditorKit, + org.apache.jackrabbit.j2ee.RepositoryAccessServlet, + org.apache.jackrabbit.util.Text" %><%@ page contentType="text/html;charset=UTF-8" %><% Repository rep; Session jcrSession; @@ -66,9 +66,9 @@ } String[] types = request.getParameterValues("filetype"); if (types != null) { - for (int i = 0; i < types.length; i++) { - filetypes.add(types[i]); - } + filetypes.addAll(Arrays.asList(types)); + } else { + filetypes = DEFAULT_TYPES; } if (seedWord != null && numDocs > 0 && filetypes.size() > 0) { %> @@ -147,7 +147,7 @@ String type = (String) filetypes.get(typeIdx); int offset = 0; while (n < numDocs * (typeIdx + 1) / filetypes.size()) { - final URL[] urls = new Search(type, seedWord, offset).getURLs(out); + final URL[] urls = new Search(type, seedWord, offset).getURLs(); if (urls.length == 0) { break; } @@ -185,7 +185,6 @@ try { String info = fileName + " (" + host + ")"; URLConnection con = currentURL.openConnection(); - con.setReadTimeout(10000); // 10 seconds InputStream in = con.getInputStream(); try { synchronized (fOut) { @@ -261,7 +260,7 @@