JAL-3332 Sensible default timeout values for network connections (8s connect_timeout...
[jalview.git] / getdown / src / getdown / core / src / main / java / com / threerings / getdown / data / Build.java.tmpl
index 60a8ff3..86ea47b 100644 (file)
@@ -40,4 +40,26 @@ public class Build {
     public static List<String> hostWhitelist () {
         return Arrays.asList(StringUtil.parseStringArray("@host_whitelist@"));
     }
+    
+    /*
+     * <p>The default connect_timeout to use.  Overridden by system property of the same name at runtime
+     */
+    public static int defaultConnectTimeout () {
+       try {
+                       return Integer.valueOf("@connect_timeout@");
+               } catch (Exception e) {
+                       return 0;
+               }
+    }
+    
+    /*
+     * <p>The default read_timeout to use.  Overridden by system property of the same name at runtime
+     */
+    public static int defaultReadTimeout () {
+       try {
+                       return Integer.valueOf("@read_timeout@");
+               } catch (Exception e) {
+                       return 30;
+               }
+    }
 }