当前位置: 首页>>代码示例>>Java>>正文


Java AbsTransport.connect方法代码示例

本文整理汇总了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;
}
 
开发者ID:wseemann,项目名称:ServeStream,代码行数:26,代码来源:MusicUtils.java

示例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;
}
 
开发者ID:wseemann,项目名称:ServeStream,代码行数:27,代码来源:HTTPRequestTask.java

示例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;
}
 
开发者ID:abeluck,项目名称:radioplayer,代码行数:26,代码来源:MusicUtils.java

示例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();
	}
}
 
开发者ID:minstrelsy,项目名称:servestream,代码行数:27,代码来源:DetermineActionTask.java

示例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();
	}
}
 
开发者ID:wseemann,项目名称:ServeStream,代码行数:35,代码来源:DetermineActionTask.java

示例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();
	}
}
 
开发者ID:abeluck,项目名称:radioplayer,代码行数:29,代码来源:DetermineActionTask.java


注:本文中的net.sourceforge.servestream.transport.AbsTransport.connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。