當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。