當前位置: 首頁>>代碼示例>>Java>>正文


Java IMediaResource.isType方法代碼示例

本文整理匯總了Java中sagex.phoenix.vfs.IMediaResource.isType方法的典型用法代碼示例。如果您正苦於以下問題:Java IMediaResource.isType方法的具體用法?Java IMediaResource.isType怎麽用?Java IMediaResource.isType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sagex.phoenix.vfs.IMediaResource的用法示例。


在下文中一共展示了IMediaResource.isType方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: visit

import sagex.phoenix.vfs.IMediaResource; //導入方法依賴的package包/類
public boolean visit(IMediaResource resource, IProgressMonitor mon) {
    if (collectedSize >= max)
        return false;

    if (mediaResourceType != null) {
        if (resource.isType(mediaResourceType.value())) {
            collected.add(resource);
            collectedSize++;
        }
    } else {
        collected.add(resource);
        collectedSize++;
    }

    if (collectedSize >= max) {
        if (mon != null) {
            mon.setCancelled(true);
        }
        return false;
    }
    return true;
}
 
開發者ID:stuckless,項目名稱:sagetv-phoenix-core,代碼行數:23,代碼來源:CollectorResourceVisitor.java

示例2: GetAllRealChildren

import sagex.phoenix.vfs.IMediaResource; //導入方法依賴的package包/類
public static List<IMediaResource> GetAllRealChildren(IMediaResource imediaresource){
    if (imediaresource==null){
        LOG.debug("GetAllRealChildren: null passed in so returning empty list");
        return Collections.emptyList();
    }
    if (phoenix.media.IsMediaType( imediaresource , "FOLDER" )){
        ViewFolder Folder = (ViewFolder) imediaresource;
        List<IMediaResource> outList = new ArrayList<IMediaResource>();
        for (Object imr : phoenix.media.GetAllChildren(Folder)){
            //LOG.debug("GetAllRealChildren: checking '" + imr + "'");
        	if (imr instanceof IMediaResource){
        		IMediaResource tIMR = (IMediaResource) imr;
        		if (!tIMR.isType(MediaResourceType.MISSINGTV.value())){
                    //LOG.debug("GetAllRealChildren: adding '" + tIMR + "'");
        			outList.add(tIMR);
        		}else{
                    //LOG.debug("GetAllRealChildren: skipping as MISSINGTV '" + tIMR + "'");
        		}
        	}else{
                //LOG.debug("GetAllRealChildren: skipping as not IMR '" + imr + "'");
        	}
        }
        return outList;
    }else{
        return Collections.emptyList();
    }
}
 
開發者ID:jusjoken,項目名稱:gemstone2,代碼行數:28,代碼來源:Source.java

示例3: IsMediaType

import sagex.phoenix.vfs.IMediaResource; //導入方法依賴的package包/類
/**
 * return true if the media type is one of the ones listed in the
 * {@link MediaResourceType} constants
 *
 * @param type {@link MediaResourceType} contant as a String
 * @return true if the media has the given type
 */
public boolean IsMediaType(Object file, String type) {
    if (file == null)
        return false;
    MediaResourceType rt = MediaResourceType.toMediaResourceType(type);
    if (rt == null)
        return false;

    IMediaResource r = GetMediaResource(file);
    if (r != null) {
        return r.isType(rt.value());
    }
    return false;
}
 
開發者ID:stuckless,項目名稱:sagetv-phoenix-core,代碼行數:21,代碼來源:MediaAPI.java

示例4: canAccept

import sagex.phoenix.vfs.IMediaResource; //導入方法依賴的package包/類
@Override
public boolean canAccept(IMediaResource res) {
    IMetadata md;
    if (res.isType(MediaResourceType.TV.value())) {
        md = ((IMediaFile) res).getMetadata();
        if (ignoreAll || ignoreThe) {
            return removeLeadingArticles(md.getEpisodeName(), (ignoreAll)).toLowerCase().startsWith(value.toLowerCase());
        } else {
            return md.getEpisodeName().toLowerCase().startsWith(value.toLowerCase());
        }
    } else {
        return false;
    }
}
 
開發者ID:stuckless,項目名稱:sagetv-phoenix-core,代碼行數:15,代碼來源:EpisodeTitleStartsWithFilter.java

示例5: canAccept

import sagex.phoenix.vfs.IMediaResource; //導入方法依賴的package包/類
public boolean canAccept(IMediaResource res) {
    if (res instanceof IMediaFolder)
        return true;
    return res.isType(type);
}
 
開發者ID:stuckless,項目名稱:sagetv-phoenix-core,代碼行數:6,代碼來源:MediaTypeFilter.java

示例6: testMediaScan

import sagex.phoenix.vfs.IMediaResource; //導入方法依賴的package包/類
@Test
public void testMediaScan() {
    makeFile("test/movies/dira/Nemo.avi");
    makeFile("test/movies/dira/Nemo.avi.properties");
    makeFile("test/movies/dira/Nemo.jpg");
    makeFile("test/movies/dira/Terminator.avi");
    makeFile("test/movies/dirb/x.avi");
    makeFile("test/movies/dirc/y/VIDEO_TS/test.vob");
    makeFile("test/movies/dirc/y/VIDEO_TS/test.buf");
    makeFile("test/movies/dird/dire/z.avi");
    makeFile("test/movies/dire/BDMV/test.m2ts");
    makeFile("test/movies/merlin/video.vob");

    final List<IMediaResource> files = new ArrayList<IMediaResource>();
    IMediaResourceVisitor vis = new IMediaResourceVisitor() {
        @Override
        public boolean visit(IMediaResource res, IProgressMonitor monitor) {
            if (res.isType(MediaResourceType.ANY_VIDEO.value())) {
                files.add(res);
            }
            return true;
        }
    };

    IMediaFolder mf = FileResourceFactory.createFolder(makeDir("test/movies"));
    mf.accept(vis, null, IMediaResource.DEEP_UNLIMITED);
    assertEquals("visitor failed", 7, files.size());
    assertEquals("children", 6, mf.getChildren().size());

    int fileCtr = 0, dirs = 0;
    for (IMediaResource r : mf.getChildren()) {
        if (r instanceof IMediaFile) {
            fileCtr++;
        } else {
            dirs++;
        }
    }

    assertEquals("files", 2, fileCtr);
    assertEquals("folders", 4, dirs);

    // media folder delete will delete everything...
    mf.delete(null);
    assertEquals("delete()", false, mf.exists());

    final List filesLeft = new LinkedList();
    sagex.phoenix.util.DirectoryScanner scanner = new DirectoryScanner(FileFileFilter.FILE);
    scanner.scan(makeDir("test/movies"), filesLeft);

    assertEquals("files left", 0, filesLeft.size());
}
 
開發者ID:stuckless,項目名稱:sagetv-phoenix-core,代碼行數:52,代碼來源:TestMediaResources.java


注:本文中的sagex.phoenix.vfs.IMediaResource.isType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。