import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
+import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
try (InputStream in = url.openStream())
{
- InputStreamReader inReader = new InputStreamReader( in, "UTF-8" );
+ InputStreamReader inReader = new InputStreamReader( in, Charset.forName( "UTF-8" ) );
LatinEntityResolutionReader latinReader = new LatinEntityResolutionReader( inReader );
this.document = reader.read( latinReader );
}
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;
import org.junit.Assert;
+import org.junit.Test;
import java.io.BufferedReader;
import java.io.File;
import java.io.Reader;
import java.io.StringWriter;
import java.net.URL;
-import org.junit.Test;
+import java.nio.charset.Charset;
/**
* LatinEntityResolutionReaderTest
- *
- *
*/
public class LatinEntityResolutionReaderTest
extends AbstractArchivaXmlTestCase
fail( "IOException: " + e.getMessage() );
}
}
-
+
@Test
public void testReaderNormalBufsize()
throws IOException
SAXReader reader = new SAXReader();
URL url = inputFile.toURL();
in = url.openStream();
- InputStreamReader inReader = new InputStreamReader( in, "UTF-8" );
+ InputStreamReader inReader = new InputStreamReader( in, Charset.forName( "UTF-8" ) );
LatinEntityResolutionReader latinReader = new LatinEntityResolutionReader( inReader );
try
{