forked from I2P_Developers/i2p.i2p
Revert all changes to the org/cybergarage library
in the 2009-08-11 whitespace cleanup at ef1c23821d433903124f7612cbc46ac096fc985b to make merging with the newer library easier.
This commit is contained in:
@ -136,15 +136,15 @@ public class Date
|
|||||||
public String getDateString()
|
public String getDateString()
|
||||||
{
|
{
|
||||||
// Thanks for Theo Beisch (10/20/04)
|
// Thanks for Theo Beisch (10/20/04)
|
||||||
Calendar _cal = getCalendar();
|
Calendar cal = getCalendar();
|
||||||
return
|
return
|
||||||
toWeekString(_cal.get(Calendar.DAY_OF_WEEK)) +", " +
|
toWeekString(cal.get(Calendar.DAY_OF_WEEK)) +", " +
|
||||||
toTimeString(_cal.get(Calendar.DATE)) + " " +
|
toTimeString(cal.get(Calendar.DATE)) + " " +
|
||||||
toMonthString(_cal.get(Calendar.MONTH)) + " " +
|
toMonthString(cal.get(Calendar.MONTH)) + " " +
|
||||||
Integer.toString(_cal.get(Calendar.YEAR)) + " " +
|
Integer.toString(cal.get(Calendar.YEAR)) + " " +
|
||||||
toTimeString(_cal.get(Calendar.HOUR_OF_DAY)) + ":" +
|
toTimeString(cal.get(Calendar.HOUR_OF_DAY)) + ":" +
|
||||||
toTimeString(_cal.get(Calendar.MINUTE)) + ":" +
|
toTimeString(cal.get(Calendar.MINUTE)) + ":" +
|
||||||
toTimeString(_cal.get(Calendar.SECOND)) + " GMT";
|
toTimeString(cal.get(Calendar.SECOND)) + " GMT";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
@ -154,11 +154,11 @@ public class Date
|
|||||||
public String getTimeString()
|
public String getTimeString()
|
||||||
{
|
{
|
||||||
// Thanks for Theo Beisch (10/20/04)
|
// Thanks for Theo Beisch (10/20/04)
|
||||||
Calendar _cal = getCalendar();
|
Calendar cal = getCalendar();
|
||||||
return
|
return
|
||||||
toDateString(_cal.get(Calendar.HOUR_OF_DAY)) +
|
toDateString(cal.get(Calendar.HOUR_OF_DAY)) +
|
||||||
(((_cal.get(Calendar.SECOND) % 2) == 0) ? ":" : " ") +
|
(((cal.get(Calendar.SECOND) % 2) == 0) ? ":" : " ") +
|
||||||
toDateString(_cal.get(Calendar.MINUTE));
|
toDateString(cal.get(Calendar.MINUTE));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -42,10 +42,10 @@ public class HTTPHeader
|
|||||||
int colonIdx = lineStr.indexOf(':');
|
int colonIdx = lineStr.indexOf(':');
|
||||||
if (colonIdx < 0)
|
if (colonIdx < 0)
|
||||||
return;
|
return;
|
||||||
String _name = new String(lineStr.getBytes(), 0, colonIdx);
|
String name = new String(lineStr.getBytes(), 0, colonIdx);
|
||||||
String _value = new String(lineStr.getBytes(), colonIdx+1, lineStr.length()-colonIdx-1);
|
String value = new String(lineStr.getBytes(), colonIdx+1, lineStr.length()-colonIdx-1);
|
||||||
setName(_name.trim());
|
setName(name.trim());
|
||||||
setValue(_value.trim());
|
setValue(value.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
@ -134,13 +134,13 @@ public class HTTPPacket
|
|||||||
try {
|
try {
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
||||||
|
|
||||||
String _firstLine = reader.readLine();
|
String firstLine = reader.readLine();
|
||||||
if (_firstLine == null || _firstLine.length() <= 0)
|
if (firstLine == null || firstLine.length() <= 0)
|
||||||
return false;
|
return false;
|
||||||
setFirstLine(_firstLine);
|
setFirstLine(firstLine);
|
||||||
|
|
||||||
// Thanks for Giordano Sassaroli <sassarol@cefriel.it> (09/03/03)
|
// Thanks for Giordano Sassaroli <sassarol@cefriel.it> (09/03/03)
|
||||||
HTTPStatus httpStatus = new HTTPStatus(_firstLine);
|
HTTPStatus httpStatus = new HTTPStatus(firstLine);
|
||||||
int statCode = httpStatus.getStatusCode();
|
int statCode = httpStatus.getStatusCode();
|
||||||
if (statCode == HTTPStatus.CONTINUE){
|
if (statCode == HTTPStatus.CONTINUE){
|
||||||
//ad hoc code for managing iis non-standard behaviour
|
//ad hoc code for managing iis non-standard behaviour
|
||||||
@ -186,7 +186,7 @@ public class HTTPPacket
|
|||||||
String chunkSizeLine = reader.readLine();
|
String chunkSizeLine = reader.readLine();
|
||||||
contentLen = Long.parseLong(new String(chunkSizeLine.getBytes(), 0, chunkSizeLine.length()-2));
|
contentLen = Long.parseLong(new String(chunkSizeLine.getBytes(), 0, chunkSizeLine.length()-2));
|
||||||
}
|
}
|
||||||
catch (Exception e) {}
|
catch (Exception e) {};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
contentLen = getContentLength();
|
contentLen = getContentLength();
|
||||||
@ -231,7 +231,7 @@ public class HTTPPacket
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
contentLen = 0;
|
contentLen = 0;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
contentLen = 0;
|
contentLen = 0;
|
||||||
@ -650,21 +650,21 @@ public class HTTPPacket
|
|||||||
try {
|
try {
|
||||||
range[0] = Long.parseLong(firstPosStr);
|
range[0] = Long.parseLong(firstPosStr);
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e) {}
|
catch (NumberFormatException e) {};
|
||||||
if (strToken.hasMoreTokens() == false)
|
if (strToken.hasMoreTokens() == false)
|
||||||
return range;
|
return range;
|
||||||
String lastPosStr = strToken.nextToken("-/");
|
String lastPosStr = strToken.nextToken("-/");
|
||||||
try {
|
try {
|
||||||
range[1] = Long.parseLong(lastPosStr);
|
range[1] = Long.parseLong(lastPosStr);
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e) {}
|
catch (NumberFormatException e) {};
|
||||||
if (strToken.hasMoreTokens() == false)
|
if (strToken.hasMoreTokens() == false)
|
||||||
return range;
|
return range;
|
||||||
String lengthStr = strToken.nextToken("/");
|
String lengthStr = strToken.nextToken("/");
|
||||||
try {
|
try {
|
||||||
range[2] = Long.parseLong(lengthStr);
|
range[2] = Long.parseLong(lengthStr);
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e) {}
|
catch (NumberFormatException e) {};
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,17 +166,17 @@ public class HTTPRequest extends HTTPPacket
|
|||||||
public ParameterList getParameterList()
|
public ParameterList getParameterList()
|
||||||
{
|
{
|
||||||
ParameterList paramList = new ParameterList();
|
ParameterList paramList = new ParameterList();
|
||||||
String _uri = getURI();
|
String uri = getURI();
|
||||||
if (_uri == null)
|
if (uri == null)
|
||||||
return paramList;
|
return paramList;
|
||||||
int paramIdx = _uri.indexOf('?');
|
int paramIdx = uri.indexOf('?');
|
||||||
if (paramIdx < 0)
|
if (paramIdx < 0)
|
||||||
return paramList;
|
return paramList;
|
||||||
while (0 < paramIdx) {
|
while (0 < paramIdx) {
|
||||||
int eqIdx = _uri.indexOf('=', (paramIdx+1));
|
int eqIdx = uri.indexOf('=', (paramIdx+1));
|
||||||
String name = _uri.substring(paramIdx+1, eqIdx);
|
String name = uri.substring(paramIdx+1, eqIdx);
|
||||||
int nextParamIdx = _uri.indexOf('&', (eqIdx+1));
|
int nextParamIdx = uri.indexOf('&', (eqIdx+1));
|
||||||
String value = _uri.substring(eqIdx+1, (0 < nextParamIdx) ? nextParamIdx : _uri.length());
|
String value = uri.substring(eqIdx+1, (0 < nextParamIdx) ? nextParamIdx : uri.length());
|
||||||
Parameter param = new Parameter(name, value);
|
Parameter param = new Parameter(name, value);
|
||||||
paramList.add(param);
|
paramList.add(param);
|
||||||
paramIdx = nextParamIdx;
|
paramIdx = nextParamIdx;
|
||||||
@ -437,15 +437,15 @@ public class HTTPRequest extends HTTPPacket
|
|||||||
if (isKeepAlive == false) {
|
if (isKeepAlive == false) {
|
||||||
try {
|
try {
|
||||||
in.close();
|
in.close();
|
||||||
} catch (Exception e) {}
|
} catch (Exception e) {};
|
||||||
if (in != null)
|
if (in != null)
|
||||||
try {
|
try {
|
||||||
out.close();
|
out.close();
|
||||||
} catch (Exception e) {}
|
} catch (Exception e) {};
|
||||||
if (out != null)
|
if (out != null)
|
||||||
try {
|
try {
|
||||||
postSocket.close();
|
postSocket.close();
|
||||||
} catch (Exception e) {}
|
} catch (Exception e) {};
|
||||||
postSocket = null;
|
postSocket = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,7 +494,6 @@ public class HTTPRequest extends HTTPPacket
|
|||||||
// toString
|
// toString
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
|
@ -97,7 +97,6 @@ public class HTTPResponse extends HTTPPacket
|
|||||||
// toString
|
// toString
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
|
@ -37,7 +37,6 @@ public class HTTPServerThread extends Thread
|
|||||||
// run
|
// run
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
HTTPSocket httpSock = new HTTPSocket(sock);
|
HTTPSocket httpSock = new HTTPSocket(sock);
|
||||||
|
@ -45,7 +45,6 @@ public class HTTPSocket
|
|||||||
setOutputStream(socket.getOutputStream());
|
setOutputStream(socket.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void finalize()
|
public void finalize()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
|
@ -101,7 +101,7 @@ public class HostInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e){}
|
catch(Exception e){};
|
||||||
return nHostAddrs;
|
return nHostAddrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ public class HostInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e){}
|
catch(Exception e){};
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,8 +89,8 @@ public class SOAPRequest extends HTTPRequest
|
|||||||
try {
|
try {
|
||||||
ByteArrayInputStream byteIn = new ByteArrayInputStream(content);
|
ByteArrayInputStream byteIn = new ByteArrayInputStream(content);
|
||||||
Parser xmlParser = SOAP.getXMLParser();
|
Parser xmlParser = SOAP.getXMLParser();
|
||||||
Node _rootNode = xmlParser.parse(byteIn);
|
Node rootNode = xmlParser.parse(byteIn);
|
||||||
soapRes.setEnvelopeNode(_rootNode);
|
soapRes.setEnvelopeNode(rootNode);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Debug.warning(e);
|
Debug.warning(e);
|
||||||
@ -170,7 +170,6 @@ public class SOAPRequest extends HTTPRequest
|
|||||||
// print
|
// print
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public void print()
|
public void print()
|
||||||
{
|
{
|
||||||
Debug.message(toString());
|
Debug.message(toString());
|
||||||
|
@ -179,7 +179,6 @@ public class SOAPResponse extends HTTPResponse
|
|||||||
// print
|
// print
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public void print()
|
public void print()
|
||||||
{
|
{
|
||||||
Debug.message(toString());
|
Debug.message(toString());
|
||||||
|
@ -272,8 +272,8 @@ public class Action
|
|||||||
actionRes.setResponse(this);
|
actionRes.setResponse(this);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
UPnPStatus _upnpStatus = getStatus();
|
UPnPStatus upnpStatus = getStatus();
|
||||||
actionRes.setFaultResponse(_upnpStatus.getCode(), _upnpStatus.getDescription());
|
actionRes.setFaultResponse(upnpStatus.getCode(), upnpStatus.getDescription());
|
||||||
}
|
}
|
||||||
if (Debug.isOn() == true)
|
if (Debug.isOn() == true)
|
||||||
actionRes.print();
|
actionRes.print();
|
||||||
|
@ -131,7 +131,6 @@ public class ControlPoint implements HTTPRequestListener
|
|||||||
this(DEFAULT_SSDP_PORT, DEFAULT_EVENTSUB_PORT);
|
this(DEFAULT_SSDP_PORT, DEFAULT_EVENTSUB_PORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void finalize()
|
public void finalize()
|
||||||
{
|
{
|
||||||
stop();
|
stop();
|
||||||
@ -507,8 +506,8 @@ public class ControlPoint implements HTTPRequestListener
|
|||||||
public void search(String target, int mx)
|
public void search(String target, int mx)
|
||||||
{
|
{
|
||||||
SSDPSearchRequest msReq = new SSDPSearchRequest(target, mx);
|
SSDPSearchRequest msReq = new SSDPSearchRequest(target, mx);
|
||||||
SSDPSearchResponseSocketList _ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
|
SSDPSearchResponseSocketList ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
|
||||||
_ssdpSearchResponseSocketList.post(msReq);
|
ssdpSearchResponseSocketList.post(msReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void search(String target)
|
public void search(String target)
|
||||||
@ -791,8 +790,8 @@ public class ControlPoint implements HTTPRequestListener
|
|||||||
|
|
||||||
int retryCnt = 0;
|
int retryCnt = 0;
|
||||||
int bindPort = getHTTPPort();
|
int bindPort = getHTTPPort();
|
||||||
HTTPServerList _httpServerList = getHTTPServerList();
|
HTTPServerList httpServerList = getHTTPServerList();
|
||||||
while (_httpServerList.open(bindPort) == false) {
|
while (httpServerList.open(bindPort) == false) {
|
||||||
retryCnt++;
|
retryCnt++;
|
||||||
if (UPnP.SERVER_RETRY_COUNT < retryCnt) {
|
if (UPnP.SERVER_RETRY_COUNT < retryCnt) {
|
||||||
Debug.warning("Failed to open HTTP event listener port " + bindPort);
|
Debug.warning("Failed to open HTTP event listener port " + bindPort);
|
||||||
@ -803,40 +802,40 @@ public class ControlPoint implements HTTPRequestListener
|
|||||||
setHTTPPort(bindPort - 1);
|
setHTTPPort(bindPort - 1);
|
||||||
bindPort = getHTTPPort();
|
bindPort = getHTTPPort();
|
||||||
}
|
}
|
||||||
_httpServerList.addRequestListener(this);
|
httpServerList.addRequestListener(this);
|
||||||
_httpServerList.start();
|
httpServerList.start();
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
// Notify Socket
|
// Notify Socket
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
|
||||||
SSDPNotifySocketList _ssdpNotifySocketList = getSSDPNotifySocketList();
|
SSDPNotifySocketList ssdpNotifySocketList = getSSDPNotifySocketList();
|
||||||
if (_ssdpNotifySocketList.open() == false) {
|
if (ssdpNotifySocketList.open() == false) {
|
||||||
Debug.warning("Failed to open SSDP notify port 1900");
|
Debug.warning("Failed to open SSDP notify port 1900");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_ssdpNotifySocketList.setControlPoint(this);
|
ssdpNotifySocketList.setControlPoint(this);
|
||||||
_ssdpNotifySocketList.start();
|
ssdpNotifySocketList.start();
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
// SeachResponse Socket
|
// SeachResponse Socket
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
|
||||||
int _ssdpPort = getSSDPPort();
|
int ssdpPort = getSSDPPort();
|
||||||
retryCnt = 0;
|
retryCnt = 0;
|
||||||
SSDPSearchResponseSocketList _ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
|
SSDPSearchResponseSocketList ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
|
||||||
while (_ssdpSearchResponseSocketList.open(_ssdpPort) == false) {
|
while (ssdpSearchResponseSocketList.open(ssdpPort) == false) {
|
||||||
retryCnt++;
|
retryCnt++;
|
||||||
if (UPnP.SERVER_RETRY_COUNT < retryCnt) {
|
if (UPnP.SERVER_RETRY_COUNT < retryCnt) {
|
||||||
Debug.warning("Failed to open SSDP search response port " + _ssdpPort);
|
Debug.warning("Failed to open SSDP search response port " + ssdpPort);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// I2P go down not up so we don't run into other I2P things
|
// I2P go down not up so we don't run into other I2P things
|
||||||
setSSDPPort(_ssdpPort - 1);
|
setSSDPPort(ssdpPort - 1);
|
||||||
_ssdpPort = getSSDPPort();
|
ssdpPort = getSSDPPort();
|
||||||
}
|
}
|
||||||
_ssdpSearchResponseSocketList.setControlPoint(this);
|
ssdpSearchResponseSocketList.setControlPoint(this);
|
||||||
_ssdpSearchResponseSocketList.start();
|
ssdpSearchResponseSocketList.start();
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
// search root devices
|
// search root devices
|
||||||
@ -879,20 +878,20 @@ public class ControlPoint implements HTTPRequestListener
|
|||||||
{
|
{
|
||||||
unsubscribe();
|
unsubscribe();
|
||||||
|
|
||||||
SSDPNotifySocketList _ssdpNotifySocketList = getSSDPNotifySocketList();
|
SSDPNotifySocketList ssdpNotifySocketList = getSSDPNotifySocketList();
|
||||||
_ssdpNotifySocketList.stop();
|
ssdpNotifySocketList.stop();
|
||||||
_ssdpNotifySocketList.close();
|
ssdpNotifySocketList.close();
|
||||||
_ssdpNotifySocketList.clear();
|
ssdpNotifySocketList.clear();
|
||||||
|
|
||||||
SSDPSearchResponseSocketList _ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
|
SSDPSearchResponseSocketList ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
|
||||||
_ssdpSearchResponseSocketList.stop();
|
ssdpSearchResponseSocketList.stop();
|
||||||
_ssdpSearchResponseSocketList.close();
|
ssdpSearchResponseSocketList.close();
|
||||||
_ssdpSearchResponseSocketList.clear();
|
ssdpSearchResponseSocketList.clear();
|
||||||
|
|
||||||
HTTPServerList _httpServerList = getHTTPServerList();
|
HTTPServerList httpServerList = getHTTPServerList();
|
||||||
_httpServerList.stop();
|
httpServerList.stop();
|
||||||
_httpServerList.close();
|
httpServerList.close();
|
||||||
_httpServerList.clear();
|
httpServerList.clear();
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
// Disposer
|
// Disposer
|
||||||
|
@ -285,13 +285,13 @@ public class Device implements org.cybergarage.http.HTTPRequestListener, SearchL
|
|||||||
|
|
||||||
public Device getRootDevice()
|
public Device getRootDevice()
|
||||||
{
|
{
|
||||||
Node _rootNode = getRootNode();
|
Node rootNode = getRootNode();
|
||||||
if (_rootNode == null)
|
if (rootNode == null)
|
||||||
return null;
|
return null;
|
||||||
Node devNode = _rootNode.getNode(Device.ELEM_NAME);
|
Node devNode = rootNode.getNode(Device.ELEM_NAME);
|
||||||
if (devNode == null)
|
if (devNode == null)
|
||||||
return null;
|
return null;
|
||||||
return new Device(_rootNode, devNode);
|
return new Device(rootNode, devNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
@ -396,13 +396,13 @@ public class Service
|
|||||||
Node actionListNode = scdpNode.getNode(ActionList.ELEM_NAME);
|
Node actionListNode = scdpNode.getNode(ActionList.ELEM_NAME);
|
||||||
if (actionListNode == null)
|
if (actionListNode == null)
|
||||||
return actionList;
|
return actionList;
|
||||||
Node _serviceNode = getServiceNode();
|
Node serviceNode = getServiceNode();
|
||||||
int nNode = actionListNode.getNNodes();
|
int nNode = actionListNode.getNNodes();
|
||||||
for (int n=0; n<nNode; n++) {
|
for (int n=0; n<nNode; n++) {
|
||||||
Node node = actionListNode.getNode(n);
|
Node node = actionListNode.getNode(n);
|
||||||
if (Action.isActionNode(node) == false)
|
if (Action.isActionNode(node) == false)
|
||||||
continue;
|
continue;
|
||||||
Action action = new Action(_serviceNode, node);
|
Action action = new Action(serviceNode, node);
|
||||||
actionList.add(action);
|
actionList.add(action);
|
||||||
}
|
}
|
||||||
return actionList;
|
return actionList;
|
||||||
@ -433,13 +433,13 @@ public class Service
|
|||||||
Node stateTableNode = getSCPDNode().getNode(ServiceStateTable.ELEM_NAME);
|
Node stateTableNode = getSCPDNode().getNode(ServiceStateTable.ELEM_NAME);
|
||||||
if (stateTableNode == null)
|
if (stateTableNode == null)
|
||||||
return stateTable;
|
return stateTable;
|
||||||
Node _serviceNode = getServiceNode();
|
Node serviceNode = getServiceNode();
|
||||||
int nNode = stateTableNode.getNNodes();
|
int nNode = stateTableNode.getNNodes();
|
||||||
for (int n=0; n<nNode; n++) {
|
for (int n=0; n<nNode; n++) {
|
||||||
Node node = stateTableNode.getNode(n);
|
Node node = stateTableNode.getNode(n);
|
||||||
if (StateVariable.isStateVariableNode(node) == false)
|
if (StateVariable.isStateVariableNode(node) == false)
|
||||||
continue;
|
continue;
|
||||||
StateVariable serviceVar = new StateVariable(_serviceNode, node);
|
StateVariable serviceVar = new StateVariable(serviceNode, node);
|
||||||
stateTable.add(serviceVar);
|
stateTable.add(serviceVar);
|
||||||
}
|
}
|
||||||
return stateTable;
|
return stateTable;
|
||||||
|
@ -46,7 +46,7 @@ public class ServiceList extends Vector
|
|||||||
try {
|
try {
|
||||||
obj = get(n);
|
obj = get(n);
|
||||||
}
|
}
|
||||||
catch (Exception e) {}
|
catch (Exception e) {};
|
||||||
return (Service)obj;
|
return (Service)obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,10 +72,10 @@ public class StateVariable extends NodeData
|
|||||||
|
|
||||||
public Service getService()
|
public Service getService()
|
||||||
{
|
{
|
||||||
Node _serviceNode = getServiceNode();
|
Node serviceNode = getServiceNode();
|
||||||
if (_serviceNode == null)
|
if (serviceNode == null)
|
||||||
return null;
|
return null;
|
||||||
return new Service(_serviceNode);
|
return new Service(serviceNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Node getStateVariableNode()
|
public Node getStateVariableNode()
|
||||||
@ -301,8 +301,8 @@ public class StateVariable extends NodeData
|
|||||||
queryRes.setResponse(retVar);
|
queryRes.setResponse(retVar);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
UPnPStatus _upnpStatus = retVar.getStatus();
|
UPnPStatus upnpStatus = retVar.getStatus();
|
||||||
queryRes.setFaultResponse(_upnpStatus.getCode(), _upnpStatus.getDescription());
|
queryRes.setFaultResponse(upnpStatus.getCode(), upnpStatus.getDescription());
|
||||||
}
|
}
|
||||||
queryReq.post(queryRes);
|
queryReq.post(queryRes);
|
||||||
return true;
|
return true;
|
||||||
|
@ -51,7 +51,6 @@ public class RenewSubscriber extends ThreadCore
|
|||||||
// Thread
|
// Thread
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
ControlPoint ctrlp = getControlPoint();
|
ControlPoint ctrlp = getControlPoint();
|
||||||
|
@ -51,7 +51,6 @@ public class Advertiser extends ThreadCore
|
|||||||
// Thread
|
// Thread
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
Device dev = getDevice();
|
Device dev = getDevice();
|
||||||
|
@ -49,7 +49,6 @@ public class Disposer extends ThreadCore
|
|||||||
// Thread
|
// Thread
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
Thread.currentThread().setName("UPnP-Disposer");
|
Thread.currentThread().setName("UPnP-Disposer");
|
||||||
|
@ -53,7 +53,6 @@ public class HTTPMUSocket
|
|||||||
open(addr, port, bindAddr);
|
open(addr, port, bindAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void finalize()
|
protected void finalize()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
|
@ -60,7 +60,6 @@ public class HTTPUSocket
|
|||||||
open(bindPort);
|
open(bindPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void finalize()
|
protected void finalize()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
|
@ -27,6 +27,7 @@ package org.cybergarage.upnp.ssdp;
|
|||||||
import java.net.*;
|
import java.net.*;
|
||||||
|
|
||||||
import org.cybergarage.net.*;
|
import org.cybergarage.net.*;
|
||||||
|
import org.cybergarage.util.*;
|
||||||
import org.cybergarage.http.*;
|
import org.cybergarage.http.*;
|
||||||
import org.cybergarage.upnp.*;
|
import org.cybergarage.upnp.*;
|
||||||
|
|
||||||
|
@ -235,7 +235,6 @@ public class SSDPPacket
|
|||||||
// toString
|
// toString
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return new String(getData());
|
return new String(getData());
|
||||||
|
@ -112,7 +112,6 @@ public class SSDPResponse extends HTTPResponse
|
|||||||
// getHeader (Override)
|
// getHeader (Override)
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getHeader()
|
public String getHeader()
|
||||||
{
|
{
|
||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
|
@ -21,7 +21,6 @@ public class ListenerList extends Vector
|
|||||||
{
|
{
|
||||||
private static final long serialVersionUID = 8039231561720446173L;
|
private static final long serialVersionUID = 8039231561720446173L;
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean add(Object obj)
|
public boolean add(Object obj)
|
||||||
{
|
{
|
||||||
if (0 <= indexOf(obj))
|
if (0 <= indexOf(obj))
|
||||||
|
@ -40,7 +40,7 @@ public class Mutex
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
Debug.warning(e);
|
Debug.warning(e);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
syncLock = true;
|
syncLock = true;
|
||||||
}
|
}
|
||||||
|
@ -74,10 +74,10 @@ public class Node
|
|||||||
public Node getRootNode()
|
public Node getRootNode()
|
||||||
{
|
{
|
||||||
Node rootNode = null;
|
Node rootNode = null;
|
||||||
Node _parentNode = getParentNode();
|
Node parentNode = getParentNode();
|
||||||
while (_parentNode != null) {
|
while (parentNode != null) {
|
||||||
rootNode = _parentNode;
|
rootNode = parentNode;
|
||||||
_parentNode = rootNode.getParentNode();
|
parentNode = rootNode.getParentNode();
|
||||||
}
|
}
|
||||||
return rootNode;
|
return rootNode;
|
||||||
}
|
}
|
||||||
@ -338,24 +338,24 @@ public class Node
|
|||||||
{
|
{
|
||||||
String indentString = getIndentLevelString(indentLevel);
|
String indentString = getIndentLevelString(indentLevel);
|
||||||
|
|
||||||
String _name = getName();
|
String name = getName();
|
||||||
String _value = getValue();
|
String value = getValue();
|
||||||
|
|
||||||
if (hasNodes() == false || hasChildNode == false) {
|
if (hasNodes() == false || hasChildNode == false) {
|
||||||
ps.print(indentString + "<" + _name);
|
ps.print(indentString + "<" + name);
|
||||||
outputAttributes(ps);
|
outputAttributes(ps);
|
||||||
// Thnaks for Tho Beisch (11/09/04)
|
// Thnaks for Tho Beisch (11/09/04)
|
||||||
if (_value == null || _value.length() == 0) {
|
if (value == null || value.length() == 0) {
|
||||||
// No value, so use short notation <node />
|
// No value, so use short notation <node />
|
||||||
ps.println(" />");
|
ps.println(" />");
|
||||||
} else {
|
} else {
|
||||||
ps.println(">" + XML.escapeXMLChars(_value) + "</" + _name + ">");
|
ps.println(">" + XML.escapeXMLChars(value) + "</" + name + ">");
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ps.print(indentString + "<" + _name);
|
ps.print(indentString + "<" + name);
|
||||||
outputAttributes(ps);
|
outputAttributes(ps);
|
||||||
ps.println(">");
|
ps.println(">");
|
||||||
|
|
||||||
@ -365,7 +365,7 @@ public class Node
|
|||||||
cnode.output(ps, indentLevel+1, true);
|
cnode.output(ps, indentLevel+1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ps.println(indentString +"</" + _name + ">");
|
ps.println(indentString +"</" + name + ">");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString(boolean hasChildNode)
|
public String toString(boolean hasChildNode)
|
||||||
|
Reference in New Issue
Block a user