• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StorageFolder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.fourthline.cling.support.model.container.StorageFolder的典型用法代码示例。如果您正苦于以下问题:Java StorageFolder类的具体用法?Java StorageFolder怎么用?Java StorageFolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StorageFolder类属于org.fourthline.cling.support.model.container包,在下文中一共展示了StorageFolder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createRootContainer

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
public Container createRootContainer() {
    StorageFolder root = new StorageFolder();
    root.setId(DispatchingContentDirectory.CONTAINER_ID_ROOT);
    root.setParentID("-1");

    MediaLibraryStatistics statistics = getDispatchingContentDirectory().getSettingsService().getMediaLibraryStatistics();
    // returning large storageUsed values doesn't play nicely with
    // some upnp clients
    //root.setStorageUsed(statistics == null ? 0 : statistics.getTotalLengthInBytes());
    root.setStorageUsed(-1L);
    root.setTitle("Airsonic Media");
    root.setRestricted(true);
    root.setSearchable(true);
    root.setWriteStatus(WriteStatus.NOT_WRITABLE);

    root.setChildCount(6);
    return root;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:19,代码来源:RootUpnpProcessor.java


示例2: browseRootMetadata

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
private BrowseResult browseRootMetadata() throws Exception {
    StorageFolder root = new StorageFolder();
    root.setId(CONTAINER_ID_ROOT);
    root.setParentID("-1");

    MediaLibraryStatistics statistics = settingsService.getMediaLibraryStatistics();
    root.setStorageUsed(statistics == null ? 0 : statistics.getTotalLengthInBytes());
    root.setTitle("Airsonic Media");
    root.setRestricted(true);
    root.setSearchable(false);
    root.setWriteStatus(WriteStatus.NOT_WRITABLE);

    List<MusicFolder> musicFolders = settingsService.getAllMusicFolders();
    root.setChildCount(musicFolders.size() + 1);  // +1 for playlists

    DIDLContent didl = new DIDLContent();
    didl.addContainer(root);
    return createBrowseResult(didl, 1, 1);
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:20,代码来源:FolderBasedContentDirectory.java


示例3: ContentDirectory

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
public ContentDirectory(){
	StorageFolder rootContainer = new StorageFolder("0","-1","Root","yaacc",2,907000l);
	rootContainer.setSearchable(true);
	rootContainer.setRestricted(false);
	content.put(rootContainer.getId(),rootContainer);
	List<MusicTrack> musicTracks = createMusicTracks("1");
	MusicAlbum musicAlbum = new MusicAlbum("1", rootContainer, "Music", "yaacc",musicTracks.size(),musicTracks);
	musicAlbum.setSearchable(true);
	musicAlbum.setRestricted(false);
	rootContainer.addContainer(musicAlbum);
	content.put(musicAlbum.getId(),musicAlbum);
	List<Photo> photos = createPhotos("2"); 
	PhotoAlbum photoAlbum = new PhotoAlbum("2", rootContainer, "Photos", "yaacc", photos.size(),photos);
	photoAlbum.setSearchable(true);
	photoAlbum.setRestricted(false);
	rootContainer.addContainer(photoAlbum);
	content.put(photoAlbum.getId(),photoAlbum);
    	
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:20,代码来源:ContentDirectory.java


示例4: createTestContentDirectory

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
/**
 * 
 */
private void createTestContentDirectory() {
	StorageFolder rootContainer = new StorageFolder("0", "-1", "root",
			"yaacc", 2, 907000L);
	rootContainer.setClazz(new DIDLObject.Class("object.container"));
	rootContainer.setRestricted(true);
	addContent(rootContainer.getId(), rootContainer);
	List<MusicTrack> musicTracks = createMusicTracks("1");
	MusicAlbum musicAlbum = new MusicAlbum("1", rootContainer, "Music",
			null, musicTracks.size(), musicTracks);
	musicAlbum.setClazz(new DIDLObject.Class("object.container"));
	musicAlbum.setRestricted(true);
	rootContainer.addContainer(musicAlbum);
	addContent(musicAlbum.getId(), musicAlbum);
	List<Photo> photos = createPhotos("2");
	PhotoAlbum photoAlbum = new PhotoAlbum("2", rootContainer, "Photos",
			null, photos.size(), photos);
	photoAlbum.setClazz(new DIDLObject.Class("object.container"));
	photoAlbum.setRestricted(true);
	rootContainer.addContainer(photoAlbum);
	addContent(photoAlbum.getId(), photoAlbum);
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:25,代码来源:YaaccContentDirectory.java


示例5: browseRootMetadata

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
private BrowseResult browseRootMetadata() throws Exception {
    StorageFolder root = new StorageFolder();
    root.setId(CONTAINER_ID_ROOT);
    root.setParentID("-1");

    MediaLibraryStatistics statistics = settingsService.getMediaLibraryStatistics();
    root.setStorageUsed(statistics == null ? 0 : statistics.getTotalLengthInBytes());
    root.setTitle("Subsonic Media");
    root.setRestricted(true);
    root.setSearchable(false);
    root.setWriteStatus(WriteStatus.NOT_WRITABLE);

    List<MusicFolder> musicFolders = settingsService.getAllMusicFolders();
    root.setChildCount(musicFolders.size() + 1);  // +1 for playlists

    DIDLContent didl = new DIDLContent();
    didl.addContainer(root);
    return createBrowseResult(didl, 1, 1);
}
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:20,代码来源:FolderBasedContentDirectory.java


示例6: createRootContainer

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
public Container createRootContainer() throws Exception {
    Container container = new StorageFolder();
    container.setId(getRootId());
    container.setTitle(getRootTitle());

    int childCount = getAllItemsSize();
    container.setChildCount(childCount);
    container.setParentID(DispatchingContentDirectory.CONTAINER_ID_ROOT);
    return container;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:11,代码来源:UpnpContentProcessor.java


示例7: createPlaylistRootContainer

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
private Container createPlaylistRootContainer() {
    Container container = new StorageFolder();
    container.setId(CONTAINER_ID_PLAYLIST_ROOT);
    container.setTitle("Playlists");

    List<Playlist> playlists = playlistService.getAllPlaylists();
    container.setChildCount(playlists.size());
    container.setParentID(CONTAINER_ID_ROOT);
    return container;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:11,代码来源:FolderBasedContentDirectory.java


示例8: browseMeta

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
@Override
public DIDLObject browseMeta(YaaccContentDirectory contentDirectory, String myId) {
	
	StorageFolder folder = new StorageFolder(ContentDirectoryIDs.MUSIC_ARTISTS_FOLDER.getId(), ContentDirectoryIDs.MUSIC_FOLDER.getId(), getContext().getString(R.string.artists), "yaacc", getSize(contentDirectory,myId),
			907000L);
	return folder;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:8,代码来源:MusicArtistsFolderBrowser.java


示例9: browseMeta

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
@Override
public DIDLObject browseMeta(YaaccContentDirectory contentDirectory, String myId) {
	
	StorageFolder folder = new StorageFolder(ContentDirectoryIDs.MUSIC_GENRES_FOLDER.getId(), ContentDirectoryIDs.MUSIC_FOLDER.getId(),getContext().getString(R.string.genres) , "yaacc", getSize(contentDirectory,myId),
			907000L);
	return folder;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:8,代码来源:MusicGenresFolderBrowser.java


示例10: browseContainer

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
@Override
public List<Container> browseContainer(YaaccContentDirectory contentDirectory, String myId) {
	List<Container> result = new ArrayList<Container>();
       Map<String,StorageFolder> folderMap= new HashMap<String,StorageFolder>();
	String[] projection = { MediaStore.Images.Media.BUCKET_ID, MediaStore.Images.Media.BUCKET_DISPLAY_NAME};
	String selection = "0 == 0 ) group by ( " + MediaStore.Images.Media.BUCKET_ID;
	String[] selectionArgs = null;
	Cursor mediaCursor = contentDirectory.getContext().getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, selection,
			selectionArgs, MediaStore.Images.Media.BUCKET_DISPLAY_NAME + " ASC");
	if (mediaCursor != null) {
		mediaCursor.moveToFirst();
		while (!mediaCursor.isAfterLast()) {
			String id = mediaCursor.getString(mediaCursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID));
               String name = mediaCursor.getString(mediaCursor.getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME));;
			StorageFolder imageFolder = new StorageFolder(ContentDirectoryIDs.IMAGES_BY_BUCKET_NAME_PREFIX.getId()+id, ContentDirectoryIDs.IMAGES_BY_BUCKET_NAMES_FOLDER.getId(), name, "yaacc", 0,90700L);
               folderMap.put(id, imageFolder);
			Log.d(getClass().getName(), "image by bucket names folder: " + id + " Name: " + name);
               mediaCursor.moveToNext();
           }
           mediaCursor.close();
           //Fetch folder size
           for(Map.Entry<String,StorageFolder> entry : folderMap.entrySet()){
               entry.getValue().setChildCount(getBucketNameFolderSize(contentDirectory, entry.getKey()));
               result.add(entry.getValue());
           }
       } else {
           Log.d(getClass().getName(), "System media store is empty.");
       }
       Collections.sort(result, new Comparator<Container>() {

		@Override
		public int compare(Container lhs, Container rhs) {
			return lhs.getTitle().compareTo(rhs.getTitle());
		}
	});

	return result;		
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:39,代码来源:ImagesByBucketNamesFolderBrowser.java


示例11: browseMeta

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
@Override
public DIDLObject browseMeta(YaaccContentDirectory contentDirectory, String myId) {
	
	StorageFolder videosFolder = new StorageFolder(ContentDirectoryIDs.VIDEOS_FOLDER.getId(), ContentDirectoryIDs.ROOT.getId(), getContext().getString(R.string.videos), "yaacc", getSize(contentDirectory,myId),
			907000L);
	return videosFolder;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:8,代码来源:VideosFolderBrowser.java


示例12: browseMeta

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
@Override
public DIDLObject browseMeta(YaaccContentDirectory contentDirectory, String myId) {
	
	StorageFolder folder = new StorageFolder(ContentDirectoryIDs.MUSIC_ALBUMS_FOLDER.getId(), ContentDirectoryIDs.MUSIC_FOLDER.getId(), getContext().getString(R.string.albums), "yaacc", getSize(contentDirectory,myId),
			907000L);
	return folder;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:8,代码来源:MusicAlbumsFolderBrowser.java


示例13: browseMeta

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
@Override
public DIDLObject browseMeta(YaaccContentDirectory contentDirectory, String myId) {
	
	StorageFolder folder = new StorageFolder(ContentDirectoryIDs.MUSIC_FOLDER.getId(), ContentDirectoryIDs.ROOT.getId(),getContext().getString(R.string.music), "yaacc", 4,
			907000L);
	return folder;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:8,代码来源:MusicFolderBrowser.java


示例14: browseMeta

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
@Override
public DIDLObject browseMeta(YaaccContentDirectory contentDirectory, String myId) {
	
	StorageFolder folder = new StorageFolder(ContentDirectoryIDs.ROOT.getId(), ContentDirectoryIDs.PARENT_OF_ROOT.getId(), "Yaacc", "yaacc", getSize(),
			907000L);
	return folder;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:8,代码来源:RootFolderBrowser.java


示例15: browseMeta

import org.fourthline.cling.support.model.container.StorageFolder; //导入依赖的package包/类
@Override
public DIDLObject browseMeta(YaaccContentDirectory contentDirectory, String myId) {
	
	StorageFolder folder = new StorageFolder(ContentDirectoryIDs.IMAGES_FOLDER.getId(), ContentDirectoryIDs.ROOT.getId(), getContext().getString(R.string.images), "yaacc", 4,
			907000L);
	return folder;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:8,代码来源:ImagesFolderBrowser.java



注:本文中的org.fourthline.cling.support.model.container.StorageFolder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FadingActionBarHelper类代码示例发布时间:2022-05-22
下一篇:
Java AnyType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap