本文整理汇总了Java中net.sourceforge.servestream.transport.AbsTransport.connect方法的典型用法代码示例。如果您正苦于以下问题:Java AbsTransport.connect方法的具体用法?Java AbsTransport.connect怎么用?Java AbsTransport.connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sourceforge.servestream.transport.AbsTransport
的用法示例。
在下文中一共展示了AbsTransport.connect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doInBackground
import net.sourceforge.servestream.transport.AbsTransport; //导入方法依赖的package包/类
@Override
protected Void doInBackground(Void... arg0) {
long [] list = new long[0];
AbsTransport transport = TransportFactory.getTransport(mUri.getProtocol());
transport.setUri(mUri);
try {
transport.connect();
if (transport.getContentType() != null && !transport.getContentType().contains("text/html")) {
list = MusicUtils.getFilesInPlaylist(mContext, mUri.getScrubbedUri().toString(), transport.getContentType(), transport.getConnection());
}
} catch (Exception e) {
e.printStackTrace();
} finally {
transport.close();
}
Message msg = new Message();
msg.obj = list;
mHandler.sendMessage(msg);
return null;
}
示例2: processUri
import net.sourceforge.servestream.transport.AbsTransport; //导入方法依赖的package包/类
private String processUri() {
UriBean uriBean = null;
AbsTransport transport = null;
String contentType = null;
try {
Uri uri = TransportFactory.getUri(mUri);
if (uri != null) {
uriBean = TransportFactory.getTransport(uri.getScheme()).createUri(uri);
}
if (uriBean != null) {
transport = TransportFactory.getTransport(uriBean.getProtocol());
transport.setUri(uriBean);
transport.connect();
contentType = transport.getContentType();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
transport.close();
}
return contentType;
}
示例3: doInBackground
import net.sourceforge.servestream.transport.AbsTransport; //导入方法依赖的package包/类
@Override
protected Void doInBackground(Void... arg0) {
long [] list = new long[0];
AbsTransport transport = TransportFactory.getTransport(mUri.getProtocol());
transport.setUri(mUri);
try {
transport.connect();
if (transport.getContentType() != null && !transport.getContentType().contains("text/html")) {
list = MusicUtils.getFilesInPlaylist(mContext, mUri.getScrubbedUri().toString(), transport.getContentType(), transport.getConnection());
}
} catch (Exception e) {
e.printStackTrace();
} finally {
transport.close();
}
Message msg = new Message();
msg.obj = list;
mHandler.sendMessage(msg);
return null;
}
示例4: processUri
import net.sourceforge.servestream.transport.AbsTransport; //导入方法依赖的package包/类
private void processUri() {
AbsTransport transport = TransportFactory.getTransport(getUri().getProtocol());
transport.setUri(getUri());
try {
transport.connect();
if (transport.getContentType() == null) {
mAction = URL_ACTION_UNDETERMINED;
} else if (transport.getContentType().contains("text/html")) {
mAction = URL_ACTION_BROWSE;
} else {
mAction = URL_ACTION_PLAY;
if (transport.isPotentialPlaylist()) {
mList = MusicUtils.getFilesInPlaylist(mContext, getUri().getScrubbedUri().toString(), transport.getContentType(), transport.getConnection());
} else {
mList = MusicUtils.storeFile(mContext, getUri().getScrubbedUri().toString());
}
}
} catch (Exception e) {
e.printStackTrace();
mAction = URL_ACTION_UNDETERMINED;
} finally {
transport.close();
}
}
示例5: processUri
import net.sourceforge.servestream.transport.AbsTransport; //导入方法依赖的package包/类
private void processUri() {
AbsTransport transport = TransportFactory.getTransport(getUri().getProtocol());
transport.setUri(getUri());
try {
transport.connect();
if (transport.getContentType() == null) {
mAction = URL_ACTION_UNDETERMINED;
} else if (transport.getContentType().contains("text/html")) {
mAction = URL_ACTION_BROWSE;
} else {
mAction = URL_ACTION_PLAY;
if (transport.isPotentialPlaylist()) {
mList = MusicUtils.getFilesInPlaylist(mContext, getUri().getScrubbedUri().toString(), transport.getContentType(), transport.getConnection());
} else {
mList = MusicUtils.storeFile(mContext, getUri().getScrubbedUri().toString());
}
}
} catch (ProtocolException ex) {
// Ugly workaround to avoid HttpURLConnection issues in KitKat
if (ex.getMessage().equals("Unexpected status line: ICY 200 OK")) {
mAction = URL_ACTION_PLAY;
mList = MusicUtils.storeFile(mContext, getUri().getScrubbedUri().toString());
} else {
mAction = URL_ACTION_UNDETERMINED;
}
} catch (Exception e) {
e.printStackTrace();
mAction = URL_ACTION_UNDETERMINED;
} finally {
transport.close();
}
}
示例6: processUri
import net.sourceforge.servestream.transport.AbsTransport; //导入方法依赖的package包/类
private void processUri() {
AbsTransport transport = TransportFactory.getTransport(getUri().getProtocol());
transport.setUri(getUri());
try {
transport.connect();
if (transport.getContentType() == null) {
mAction = URL_ACTION_UNDETERMINED;
} else if (transport.getContentType().contains("text/html")) {
mAction = URL_ACTION_BROWSE;
} else {
mAction = URL_ACTION_PLAY;
if (transport.isPotentialPlaylist()) {
Log.d("DETERMINESHIT", getUri().toString());
Log.d("DETERMINESHIT", getUri().getScrubbedUri().toString());
mList = MusicUtils.getFilesInPlaylist(mContext, getUri().getScrubbedUri().toString(), transport.getContentType(), transport.getConnection());
} else {
mList = MusicUtils.storeFile(mContext, getUri().getScrubbedUri().toString());
}
}
} catch (Exception e) {
e.printStackTrace();
mAction = URL_ACTION_UNDETERMINED;
} finally {
transport.close();
}
}