Preliminary work on HTML client.
[stereo.git] / DAAPLib / src / util / command / PageRequest.java
blobdc7d2b3e02b3f948ffd92ee4d44c4cc249b385c9
1 package util.command;
3 import interfaces.DJInterface;
5 import java.io.File;
6 import java.io.IOException;
7 import java.net.URISyntaxException;
8 import java.util.Map;
9 import java.util.Scanner;
11 import util.node.Node;
12 import util.node.PageNode;
14 public class PageRequest implements Command {
16 public void init(Map<String, String> args) {
17 // TODO Auto-generated method stub
21 public Node run(DJInterface dj) {
23 String body = "";
24 try {
25 File f = new File(PageRequest.class.getResource("stereo.html").toURI());
26 Scanner sc = new Scanner(f);
27 while (sc.hasNextLine()) {
28 body += sc.nextLine() + "\r\n";
30 return new PageNode("text/html", body);
31 } catch (IOException e) {
32 // TODO Auto-generated catch block
33 e.printStackTrace();
34 } catch (URISyntaxException e) {
35 // TODO Auto-generated catch block
36 e.printStackTrace();
39 return null;