RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
ResourceRequestProcessor.java
1/*
2 * Copyright (c) 2013 Creative Sphere Limited.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
7 *
8 * Unless required by applicable law or agreed to in writing,
9 * software distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 *
14 * Contributors:
15 *
16 * Creative Sphere - initial API and implementation
17 *
18 */
19package org.ah.java.remotevmlauncher.protocol;
20
21import java.io.DataInputStream;
22import java.io.DataOutputStream;
23import java.io.IOException;
24
31public class ResourceRequestProcessor extends AbstractProcessor {
32
33 public static final String ID = "RR";
34
35 private String pathId;
36 private String resourceName;
37
38 public ResourceRequestProcessor() {
39 super(ID);
40 }
41
42 public String getPathId() {
43 return pathId;
44 }
45
46 public void setPathId(String pathId) {
47 this.pathId = pathId;
48 }
49
50 public String getResourceName() {
51 return resourceName;
52 }
53
54 public void setResourceName(String resourceName) {
55 this.resourceName = resourceName;
56 }
57
58 public void receive(DataInputStream dis) throws IOException {
59 pathId = dis.readUTF();
60 resourceName = dis.readUTF();
61 processRequest(pathId, resourceName);
62 }
63
64 public void processRequest(String pathId, String resourceName) throws IOException {
65 }
66
67 public void send(DataOutputStream dos) throws IOException {
68 dos.writeUTF(getId());
69 dos.writeUTF(pathId);
70 dos.writeUTF(resourceName);
71 dos.flush();
72 }
73}