xx <tag a ="b" c= 'd' e=f> yy </tag> zz
(Did you noticed the single,double and no-quote attribute
values and spaces ? It is important to consider all these variations.)
import java.io.*;
import java.util.zip.*;
public class UnzipTest {
public static void unzipFile(File f) throws ZipException, IOException {
ZipInputStream zin = new ZipInputStream(new FileInputStream(f));
System.out.println(f.getAbsoluteFile());
String workingDir = f.getPath() + File.separator + "unziped";
byte buffer[] = new byte[4096];
int bytesRead;
public class TreeTest {
public static void main(String[] args) {
showDir(1, new File("D:\\test"));
}
static void showDir(int indent, File file) {
for (int i = 0; i < indent; i++)
System.out.print(' ');
System.out.println(file.getName());
if (file.isDirectory()) {
File[] files = file.listFiles();
for (int i = 0; i < files.length; i++)
showDir(indent + 4, files[i]);
}
}
}
String SPACE =" ";
String [] words = input.split(SPACE);
Map<String,Integer> frequency = new HashMap<String,Integer>();
for (String word:words){
Integer f = frequency.get(word);
frequency.put(word,f+1);
}
frequency.get(word);
The code to ping a URL from java application is as follows :
With response time: