equivalent to Files.readAllLines() for InputStream or Reader?

An InputStream represents a stream of bytes. Those bytes don’t necessarily form (text) content that can be read line by line. If you know that the InputStream can be interpreted as text, you can wrap it in a InputStreamReader and use BufferedReader#lines() to consume it line by line. try (InputStream resource = Example.class.getResourceAsStream(“resource”)) { List<String> … Read more

Android Library Gradle release JAR

While I haven’t tried uploading the artifacts with a deployment to Sonatype (or even a local repo), here’s what I managed to come up with a few weeks ago when trying to tackle the same problem. android.libraryVariants.all { variant -> def name = variant.buildType.name if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { return; // Skip debug builds. } def task … Read more

How to extract .war files in java? ZIP vs JAR

WAR file is just a JAR file, to extract it, just issue following jar command – jar -xvf yourWARfileName.war If the jar command is not found, which sometimes happens in the Windows command prompt, then specify full path i.e. in my case it is, c:\java\jdk-1.7.0\bin\jar -xvf my-file.war

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)