Back to project page twawm2.
The source code is released under:
Copyright (c) 2014, afnf All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistr...
If you think the Android project twawm2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.appspot.afnf4199ga.utils; //from w ww . jav a 2 s . c o m import java.io.IOException; import java.io.InputStream; import java.net.URL; import org.apache.commons.io.IOUtils; import com.appspot.afnf4199ga.twawm.Const; public class MyTestUtils { public static String getResourceAsString(String path) { return getResourceAsString(path, true); } public static String getResourceAsString(String path, boolean eucjp) { InputStream resourceAsStream = null; String content = null; try { resourceAsStream = MyTestUtils.class.getResourceAsStream(path); content = IOUtils.toString(resourceAsStream, eucjp ? Const.ROUTER_PAGE_CHARSET_WM : Const.ROUTER_PAGE_CHARSET_NAD); } catch (IOException e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(resourceAsStream); } return content; } }