[jsword-svn] common/java/core/org/crosswire/common/util s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Tue Sep 28 15:25:05 MST 2004
Update of /cvs/jsword/common/java/core/org/crosswire/common/util
In directory www.crosswire.org:/tmp/cvs-serv14638/java/core/org/crosswire/common/util
Modified Files:
NetUtil.java
Log Message:
User confirmation of download
Index: NetUtil.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/util/NetUtil.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** NetUtil.java 21 Sep 2004 17:45:47 -0000 1.10
--- NetUtil.java 28 Sep 2004 22:25:03 -0000 1.11
***************
*** 11,14 ****
--- 11,15 ----
import java.net.MalformedURLException;
import java.net.URL;
+ import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Arrays;
***************
*** 501,504 ****
--- 502,523 ----
/**
+ * @param url the resource whose size is wanted
+ * @return the size of that resource
+ */
+ public static int getSize(URL url)
+ {
+ try
+ {
+ URLConnection urlConnection = url.openConnection();
+ int size = urlConnection.getContentLength();
+ return size;
+ }
+ catch (IOException e)
+ {
+ return 0;
+ }
+ }
+
+ /**
* When was the given URL last modified. If no modification time is
* available then this method return the current time.
More information about the jsword-svn
mailing list