本文整理汇总了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;未经允许,请勿转载。 |
请发表评论