⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmsobject.java

📁 java 编写的程序
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not existing in the offline project already,
 * it is read from the online project and written into the offline project.
 * <p>
 * <B>Security:</B>
 * Access is granted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user is owner of the resource or is admin</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param newGroup the name of the new group for this resource.
 *
 * @exception CmsException if operation was not successful.
 */
public void chgrp(String filename, String newGroup) throws CmsException {
    CmsResource res = readFileHeader(filename);
    I_CmsResourceType rt = getResourceType(res.getType());
    rt.chgrp(this, filename, newGroup, false);
}

/**
 * Changes the group of a resource.
 * <br>
 * Only the group of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not existing in the offline project already,
 * it is read from the online project and written into the offline project.
 * <p>
 * <B>Security:</B>
 * Access is granted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user is owner of the resource or is admin</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param newGroup the name of the new group for this resource.
 * @param chRekursive shows if the subResources (of a folder) should be changed too.
 *
 * @exception CmsException if operation was not successful.
 */
public void chgrp(String filename, String newGroup, boolean chRekursive) throws CmsException {
    CmsResource res = readFileHeader(filename);
    I_CmsResourceType rt = getResourceType(res.getType());
    rt.chgrp(this, filename, newGroup, chRekursive);
}

/**
 * Changes the group of a resource.
 * <br>
 * Only the group of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not existing in the offline project already,
 * it is read from the online project and written into the offline project.
 * <p>
 * <B>Security:</B>
 * Access is granted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user is owner of the resource or is admin</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param newGroup the name of the new group for this resource.
 *
 * @exception CmsException if operation was not successful.
 */
protected void doChgrp(String filename, String newGroup) throws CmsException {
    m_rb.chgrp(m_context.currentUser(), m_context.currentProject(), getSiteRoot(filename), newGroup);
}

/**
 * Changes the flags of a resource.
 * <br>
 * Only the flags of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not existing in the offline project already,
 * it is read from the online project and written into the offline project.
 * The user may change the flags, if he is admin of the resource.
 * <p>
 * <B>Security:</B>
 * Access is granted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user can write the resource</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param flags the new flags for the resource.
 *
 * @exception CmsException if operation was not successful.
 * for this resource.
 */
public void chmod(String filename, int flags) throws CmsException {
    CmsResource res = readFileHeader(filename);
    I_CmsResourceType rt = getResourceType(res.getType());
    rt.chmod(this, filename, flags, false);
}

/**
 * Changes the flags of a resource.
 * <br>
 * Only the flags of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not existing in the offline project already,
 * it is read from the online project and written into the offline project.
 * The user may change the flags, if he is admin of the resource.
 * <p>
 * <B>Security:</B>
 * Access is granted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user can write the resource</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param flags the new flags for the resource.
 * @param chRekursive shows if the subResources (of a folder) should be changed too.
 *
 * @exception CmsException if operation was not successful.
 * for this resource.
 */
public void chmod(String filename, int flags, boolean chRekursive) throws CmsException {
    CmsResource res = readFileHeader(filename);
    I_CmsResourceType rt = getResourceType(res.getType());
    rt.chmod(this, filename, flags, chRekursive);
}

/**
 * Changes the flags of a resource.
 * <br>
 * Only the flags of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not existing in the offline project already,
 * it is read from the online project and written into the offline project.
 * The user may change the flags, if he is admin of the resource.
 * <p>
 * <B>Security:</B>
 * Access is granted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user can write the resource</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param flags the new flags for the resource.
 *
 * @exception CmsException if operation was not successful.
 * for this resource.
 */
protected void doChmod(String filename, int flags) throws CmsException {
    m_rb.chmod(m_context.currentUser(), m_context.currentProject(), getSiteRoot(filename), flags);
}

/**
 * Changes the owner of a resource.
 * <br>
 * Only the owner of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not existing in the offline project already,
 * it is read from the online project and written into the offline project.
 * The user may change this, if he is admin of the resource.
 * <p>
 * <B>Security:</B>
 * Access is cranted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user is owner of the resource or the user is admin</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param newOwner the name of the new owner for this resource.
 *
 * @exception CmsException if operation was not successful.
 */
public void chown(String filename, String newOwner) throws CmsException {
    CmsResource res = readFileHeader(filename);
    I_CmsResourceType rt = getResourceType(res.getType());
    rt.chown(this, filename, newOwner, false);
}

/**
 * Changes the owner of a resource.
 * <br>
 * Only the owner of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not existing in the offline project already,
 * it is read from the online project and written into the offline project.
 * The user may change this, if he is admin of the resource.
 * <p>
 * <B>Security:</B>
 * Access is cranted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user is owner of the resource or the user is admin</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param newOwner the name of the new owner for this resource.
 * @param chRekursive shows if the subResources (of a folder) should be changed too.
 *
 * @exception CmsException if operation was not successful.
 */
public void chown(String filename, String newOwner, boolean chRekursive) throws CmsException {
    CmsResource res = readFileHeader(filename);
    I_CmsResourceType rt = getResourceType(res.getType());
    rt.chown(this, filename, newOwner, chRekursive);
}

/**
 * Changes the owner of a resource.
 * <br>
 * Only the owner of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not existing in the offline project already,
 * it is read from the online project and written into the offline project.
 * The user may change this, if he is admin of the resource.
 * <p>
 * <B>Security:</B>
 * Access is cranted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user is owner of the resource or the user is admin</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param newOwner the name of the new owner for this resource.
 *
 * @exception CmsException if operation was not successful.
 */
protected void doChown(String filename, String newOwner) throws CmsException {
    m_rb.chown(m_context.currentUser(), m_context.currentProject(), getSiteRoot(filename), newOwner);
}

/**
 * Changes the resourcetype of a resource.
 * <br>
 * Only the resourcetype of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not exisiting in the offline project already,
 * it is read from the online project and written into the offline project.
 * The user may change this, if he is admin of the resource.
 * <p>
 * <B>Security:</B>
 * Access is granted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user is owner of the resource or is admin</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param newType the name of the new resourcetype for this resource.
 *
 * @exception CmsException if operation was not successful.
 */
public void chtype(String filename, String newType) throws CmsException {
    CmsResource res = readFileHeader(filename);
    I_CmsResourceType rt = getResourceType(res.getType());
    rt.chtype(this, filename, newType);
}

/**
 * Changes the resourcetype of a resource.
 * <br>
 * Only the resourcetype of a resource in an offline project can be changed. The state
 * of the resource is set to CHANGED (1).
 * If the content of this resource is not exisiting in the offline project already,
 * it is read from the online project and written into the offline project.
 * The user may change this, if he is admin of the resource.
 * <p>
 * <B>Security:</B>
 * Access is granted, if:
 * <ul>
 * <li>the user has access to the project</li>
 * <li>the user is owner of the resource or is admin</li>
 * <li>the resource is locked by the callingUser</li>
 * </ul>
 *
 * @param filename the complete path to the resource.
 * @param newType the name of the new resourcetype for this resource.
 *
 * @exception CmsException if operation was not successful.
 */
protected void doChtype(String filename, String newType) throws CmsException {
    m_rb.chtype(m_context.currentUser(), m_context.currentProject(), getSiteRoot(filename), newType);
}

/**
 * Clears all internal DB-Caches.
 */
public void clearcache() {
    m_rb.clearcache();
    System.gc();
}

/**
 * Copies a file.
 *
 * @param source the complete path of the sourcefile.
 * @param destination the complete path of the destinationfolder.
 *
 * @exception CmsException if the file couldn't be copied, or the user
 * has not the appropriate rights to copy the file.
 */
public void copyResource(String source, String destination) throws CmsException {
    CmsResource res = readFileHeader(source);
    I_CmsResourceType rt = getResourceType(res.getType());
    rt.copyResource(this, source, destination, false);
}
/**
 * Copies a file.
 *
 * @param source the complete path of the sourcefile.
 * @param destination the complete path of the destinationfolder.
 * @param keepFlags <code>true</code> if the copy should keep the source file's flags,
 *        <code>false</code> if the copy should get the user's default flags.
 *
 * @exception CmsException if the file couldn't be copied, or the user
 * has not the appropriate rights to copy the file.
 */
public void copyResource(String source, String destination, boolean keepFlags) throws CmsException {
    CmsResource res = readFileHeader(source);
    I_CmsResourceType rt = getResourceType(res.getType());
    rt.copyResource(this, source, destination, keepFlags);
}
/**

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -