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


Java IMediaResource.getParent方法代码示例

本文整理汇总了Java中sagex.phoenix.vfs.IMediaResource.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java IMediaResource.getParent方法的具体用法?Java IMediaResource.getParent怎么用?Java IMediaResource.getParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sagex.phoenix.vfs.IMediaResource的用法示例。


在下文中一共展示了IMediaResource.getParent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: GetFactoryId

import sagex.phoenix.vfs.IMediaResource; //导入方法依赖的package包/类
/**
 * Given the {@link IMediaResource} return the {@link Factory} that created
 * it.
 *
 * @param res
 * @return
 */
public String GetFactoryId(IMediaResource res) {
    if (res == null)
        return null;
    if (res instanceof ViewFolder) {
        return ((ViewFolder) res).getViewFactory().getName();
    } else if (res.getParent() != null) {
        return GetFactoryId(res.getParent());
    }
    return null;
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:18,代码来源:MediaBrowserAPI.java

示例2: DeleteItem

import sagex.phoenix.vfs.IMediaResource; //导入方法依赖的package包/类
/**
 * Physically deletes a file and removes it from its parent.
 * <p/>
 * withoutPrejudice is a flag to tell sage tv that this item is being
 * deleted as a result of an incorrect recording, etc, so that intelligent
 * recordings can function correctly.
 *
 * @param res
 * @param withoutPrejudice
 */
public boolean DeleteItem(IMediaResource res, boolean withoutPrejudice) {
    // physically delete the file
    boolean deleted = res.delete(new Hints(IMediaResource.HINT_DELETE_WITHOUT_PREJUDICE, String.valueOf(withoutPrejudice)));

    if (deleted) {
        // remove it from the parent files
        if (res.getParent() != null) {
            res.getParent().getChildren().remove(res);
        }
    }
    return deleted;
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:23,代码来源:ViewAPI.java

示例3: getLocation

import sagex.phoenix.vfs.IMediaResource; //导入方法依赖的package包/类
/**
 * Returns the Path for the given resource. If the resouce has a fileystem
 * File object, then the path of that File is returned, otherwise, it will
 * build up a virtual path as a unix style path, of the given resource and
 * its parent resources.
 *
 * @param res
 * @return
 */
public static String getLocation(IMediaResource res) {
    String loc = null;
    if (res instanceof IMediaFile) {
        File f = getFirstFile((IMediaFile) res);
        if (f != null) {
            loc = f.getAbsolutePath();
        }
    }

    if (loc == null) {
        List<String> paths = new ArrayList<String>();
        paths.add(res.getTitle());
        IMediaResource r = res;
        while ((r = r.getParent()) != null) {
            paths.add(0, r.getTitle());
        }

        StringBuffer sb = new StringBuffer();
        for (String s : paths) {
            sb.append("/");
            sb.append(s);
        }
        loc = sb.toString();
    }

    return loc;
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:37,代码来源:PathUtils.java

示例4: getPathAsUrl

import sagex.phoenix.vfs.IMediaResource; //导入方法依赖的package包/类
public static String getPathAsUrl(IMediaResource res) {
    StringBuilder sb = new StringBuilder();
    do {
        sb.insert(0, "/" + UrlUtil.encode(res.getTitle()));
    } while ((res = res.getParent()) != null);
    return sb.toString();
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:8,代码来源:PathUtils.java

示例5: createFolder

import sagex.phoenix.vfs.IMediaResource; //导入方法依赖的package包/类
/**
 * Convenience method to create a Folder. If the file is not a directory,
 * then a directory of the parent is created.
 */
public static IMediaFolder createFolder(IMediaFolder parent, File f) {
    if (f == null)
        return null;

    IMediaResource r = createResource(parent, f);
    if (r instanceof IMediaFolder) {
        return (IMediaFolder) r;
    } else {
        return r.getParent();
    }
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:16,代码来源:FileResourceFactory.java

示例6: getParent

import sagex.phoenix.vfs.IMediaResource; //导入方法依赖的package包/类
private String getParent(IMediaResource res) {
    if (res == null)
        return "NULL";
    if (res.getParent() != null)
        return res.getParent().getTitle();
    return "ROOT";
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:8,代码来源:SimpleSTDOUTVisitor.java

示例7: GetParent

import sagex.phoenix.vfs.IMediaResource; //导入方法依赖的package包/类
/**
 * Gets the parent for the given folder
 *
 * @param res
 * @return
 */
public IMediaFolder GetParent(IMediaResource res) {
    return res.getParent();
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:10,代码来源:MediaBrowserAPI.java

示例8: HasParent

import sagex.phoenix.vfs.IMediaResource; //导入方法依赖的package包/类
/**
 * Return true if the given folder has a parent.
 *
 * @param res
 * @return
 */
public boolean HasParent(IMediaResource res) {
    return res.getParent() != null;
}
 
开发者ID:stuckless,项目名称:sagetv-phoenix-core,代码行数:10,代码来源:MediaBrowserAPI.java


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