Commits
md_5 authored 1f7c0c759ce
785 785 | } else |
786 786 | { |
787 787 | System.out.println( "Found good Minecraft hash (" + hash + ")" ); |
788 788 | return true; |
789 789 | } |
790 790 | } |
791 791 | |
792 792 | public static final String get(String url) throws IOException |
793 793 | { |
794 794 | URLConnection con = new URL( url ).openConnection(); |
795 - | con.setConnectTimeout( 5000 ); |
796 - | con.setReadTimeout( 5000 ); |
795 + | con.setConnectTimeout( 30000 ); |
796 + | con.setReadTimeout( 30000 ); |
797 797 | |
798 798 | try ( InputStreamReader r = new InputStreamReader( con.getInputStream() ) ) |
799 799 | { |
800 800 | return CharStreams.toString( r ); |
801 801 | } |
802 802 | } |
803 803 | |
804 804 | public static void copyJar(String path, final String jarPrefix, final String jarSuffix, File outJar) throws Exception |
805 805 | { |
806 806 | File[] files = new File( path ).listFiles( (dir, name) -> name.startsWith( jarPrefix ) && name.endsWith( jarSuffix ) ); |