本文整理了Java中org.cybergarage.util.Debug.warning()
方法的一些代码示例,展示了Debug.warning()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Debug.warning()
方法的具体详情如下:
包路径:org.cybergarage.util.Debug
类名称:Debug
方法名:warning
暂无
代码示例来源:origin: i2p/i2p.i2p
public synchronized void lock()
{
while(syncLock == true) {
try {
wait();
}
catch (Exception e) {
Debug.warning(e);
};
}
syncLock = true;
}
代码示例来源:origin: i2p/i2p.i2p
public final static int toInteger(String value)
{
try {
return Integer.parseInt(value);
}
catch (Exception e) {
Debug.warning(e);
}
return 0;
}
代码示例来源:origin: i2p/i2p.i2p
public final static long toLong(String value)
{
try {
return Long.parseLong(value);
}
catch (Exception e) {
Debug.warning(e);
}
return 0;
}
代码示例来源:origin: i2p/i2p.i2p
public boolean close()
{
if (ssdpUniSock == null)
return true;
try {
ssdpUniSock.close();
ssdpUniSock = null;
}
catch (Exception e) {
Debug.warning(e);
return false;
}
return true;
}
代码示例来源:origin: i2p/i2p.i2p
public boolean close()
{
if (serverSock == null)
return true;
try {
serverSock.close();
serverSock = null;
bindAddr = null;
bindPort = 0;
}
catch (Exception e) {
Debug.warning(e);
return false;
}
return true;
}
代码示例来源:origin: i2p/i2p.i2p
public boolean open(String addr, int port)
{
if (serverSock != null)
return true;
try {
bindAddr = InetAddress.getByName(addr);
bindPort = port;
serverSock = new ServerSocket(bindPort, 0, bindAddr);
}
catch (IOException e) {
Debug.warning("HTTP server open failed " + addr + " " + port, e);
return false;
}
return true;
}
代码示例来源:origin: i2p/i2p.i2p
public boolean open()
{
close();
try {
ssdpUniSock = new DatagramSocket();
}
catch (Exception e) {
Debug.warning(e);
return false;
}
return true;
}
代码示例来源:origin: i2p/i2p.i2p
public final static byte[] load(String fileName)
{
try {
FileInputStream fin=new FileInputStream(fileName);
return load(fin);
}
catch (Exception e) {
Debug.warning(e);
return new byte[0];
}
}
代码示例来源:origin: i2p/i2p.i2p
public final static byte[] load(File file)
{
try {
FileInputStream fin=new FileInputStream(file);
return load(fin);
}
catch (Exception e) {
Debug.warning(e);
return new byte[0];
}
}
代码示例来源:origin: i2p/i2p.i2p
public boolean open(String addr, int port, String bindAddr)
{
try {
return open(addr,port,InetAddress.getByName(bindAddr));
}catch (Exception e) {
Debug.warning(e);
return false;
}
}
代码示例来源:origin: i2p/i2p.i2p
public boolean post(String addr, int port, String msg)
{
try {
InetAddress inetAddr = InetAddress.getByName(addr);
DatagramPacket dgmPacket = new DatagramPacket(msg.getBytes(), msg.length(), inetAddr, port);
ssdpUniSock.send(dgmPacket);
}
catch (Exception e) {
Debug.warning("addr = " +ssdpUniSock.getLocalAddress().getHostName());
Debug.warning("port = " + ssdpUniSock.getLocalPort());
Debug.warning(e);
return false;
}
return true;
}
代码示例来源:origin: i2p/i2p.i2p
public String getContentString()
{
String charSet = getCharSet();
if (charSet == null || charSet.length() <= 0)
return new String(content);
try {
return new String(content, charSet);
}
catch (Exception e) {
Debug.warning(e);
}
return new String(content);
}
代码示例来源:origin: i2p/i2p.i2p
public final static byte[] load(FileInputStream fin)
{
byte readBuf[] = new byte[512*1024];
try {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
int readCnt = fin.read(readBuf);
while (0 < readCnt) {
bout.write(readBuf, 0, readCnt);
readCnt = fin.read(readBuf);
}
fin.close();
return bout.toByteArray();
}
catch (Exception e) {
Debug.warning(e);
return new byte[0];
}
}
代码示例来源:origin: i2p/i2p.i2p
public final static int getLeaseTime(String cacheCont){
/*
* Search for max-age keyword instead of equals sign Found value of
* max-age ends at next comma or end of string
*/
int mx = 0;
int maxAgeIdx = cacheCont.indexOf("max-age");
if (maxAgeIdx >= 0) {
int endIdx = cacheCont.indexOf(',',maxAgeIdx);
if (endIdx < 0)
endIdx = cacheCont.length();
try {
maxAgeIdx = cacheCont.indexOf("=",maxAgeIdx);
String mxStr = cacheCont.substring(maxAgeIdx+1,endIdx).trim();
mx = Integer.parseInt(mxStr);
} catch (Exception e) {
Debug.warning (e);
}
}
return mx;
}
}
代码示例来源:origin: i2p/i2p.i2p
/**
* @param addr {@link String} rappresenting the multicast hostname to join into.
* @param port int rappresenting the port to be use poth as source and destination
* @param bindAddr {@link InetAddress} which identify the hostname of the interface
* to use for sending and recieving multicast packet
*/
public boolean open(String addr,int port, InetAddress bindAddr){
try {
ssdpMultiSock = new MulticastSocket(null);
ssdpMultiSock.setReuseAddress(true);
InetSocketAddress bindSockAddr = new InetSocketAddress(port);
ssdpMultiSock.bind(bindSockAddr);
ssdpMultiGroup = new InetSocketAddress(InetAddress.getByName(addr), port);
ssdpMultiIf = NetworkInterface.getByInetAddress(bindAddr);
ssdpMultiSock.joinGroup(ssdpMultiGroup, ssdpMultiIf);
}
catch (Exception e) {
Debug.warning(e);
return false;
}
return true;
}
代码示例来源:origin: i2p/i2p.i2p
private synchronized Node getRootNode()
{
if (rootNode != null)
return rootNode;
try {
byte content[] = getContent();
ByteArrayInputStream contentIn = new ByteArrayInputStream(content);
Parser parser = SOAP.getXMLParser();
rootNode = parser.parse(contentIn);
}
catch (ParserException e) {
Debug.warning(e);
}
return rootNode;
}
代码示例来源:origin: i2p/i2p.i2p
public boolean send(String msg, String bindAddr, int bindPort)
{
MulticastSocket msock = null;
try {
if ((bindAddr) != null && (0 < bindPort)) {
msock = new MulticastSocket(null);
msock.bind(new InetSocketAddress(bindAddr, bindPort));
}else{
msock = new MulticastSocket();
}
DatagramPacket dgmPacket = new DatagramPacket(msg.getBytes(), msg.length(), ssdpMultiGroup);
// Thnaks for Theo Beisch (11/09/04)
msock.setTimeToLive(UPnP.getTimeToLive());
msock.send(dgmPacket);
}
catch (Exception e) {
Debug.warning(e);
return false;
} finally {
if (msock != null) msock.close();
}
return true;
}
代码示例来源:origin: i2p/i2p.i2p
public void performNotifyListener(SSDPPacket ssdpPacket)
{
int listenerSize = deviceNotifyListenerList.size();
for (int n=0; n<listenerSize; n++) {
NotifyListener listener = (NotifyListener)deviceNotifyListenerList.get(n);
try{
listener.deviceNotifyReceived(ssdpPacket);
}catch(Exception e){
Debug.warning("NotifyListener returned an error:", e);
}
}
}
代码示例来源:origin: i2p/i2p.i2p
public void performSearchResponseListener(SSDPPacket ssdpPacket)
{
int listenerSize = deviceSearchResponseListenerList.size();
for (int n=0; n<listenerSize; n++) {
SearchResponseListener listener = (SearchResponseListener)deviceSearchResponseListenerList.get(n);
try{
listener.deviceSearchResponseReceived(ssdpPacket);
}catch(Exception e){
Debug.warning("SearchResponseListener returned an error:", e);
}
}
}
代码示例来源:origin: i2p/i2p.i2p
public SOAPResponse postMessage(String host, int port)
{
HTTPResponse httpRes = post(host, port);
SOAPResponse soapRes = new SOAPResponse(httpRes);
byte content[] = soapRes.getContent();
if (content.length <= 0)
return soapRes;
try {
ByteArrayInputStream byteIn = new ByteArrayInputStream(content);
Parser xmlParser = SOAP.getXMLParser();
Node rootNode = xmlParser.parse(byteIn);
soapRes.setEnvelopeNode(rootNode);
}
catch (Exception e) {
Debug.warning(e);
}
return soapRes;
}
内容来源于网络,如有侵权,请联系作者删除!