Java 类com.liferay.portal.kernel.util.DigesterUtil 实例源码

项目:ch-inofix-timetracker    文件:TaskRecordServiceImpl.java   
@Override
public FileEntry addTempFileEntry(long groupId, String folderName, String fileName, InputStream inputStream,
        String mimeType) throws PortalException {

    TimetrackerPortletPermission.check(getPermissionChecker(), groupId, TimetrackerActionKeys.IMPORT_TASK_RECORDS);

    return TempFileEntryUtil.addTempFileEntry(groupId, getUserId(),
            DigesterUtil.digestHex(Digester.SHA_256, folderName), fileName, inputStream, mimeType);
}
项目:ch-inofix-timetracker    文件:TaskRecordServiceImpl.java   
@Override
public void deleteTempFileEntry(long groupId, String folderName, String fileName) throws PortalException {

    TimetrackerPortletPermission.check(getPermissionChecker(), groupId,
            TimetrackerActionKeys.EXPORT_IMPORT_TASK_RECORDS);

    TempFileEntryUtil.deleteTempFileEntry(groupId, getUserId(),
            DigesterUtil.digestHex(Digester.SHA_256, folderName), fileName);
}
项目:ch-inofix-timetracker    文件:TaskRecordServiceImpl.java   
@Override
public String[] getTempFileNames(long groupId, String folderName) throws PortalException {

    TimetrackerPortletPermission.check(getPermissionChecker(), groupId,
            TimetrackerActionKeys.EXPORT_IMPORT_TASK_RECORDS);

    return TempFileEntryUtil.getTempFileNames(groupId, getUserId(),
            DigesterUtil.digestHex(Digester.SHA_256, folderName));
}
项目:ch-inofix-contact-manager    文件:ContactServiceImpl.java   
@Override
public FileEntry addTempFileEntry(long groupId, String folderName, String fileName, InputStream inputStream,
        String mimeType) throws PortalException {

    ContactManagerPortletPermission.check(getPermissionChecker(), groupId, ContactManagerActionKeys.EXPORT_IMPORT_CONTACTS);

    return TempFileEntryUtil.addTempFileEntry(groupId, getUserId(),
            DigesterUtil.digestHex(Digester.SHA_256, folderName), fileName, inputStream, mimeType);
}
项目:ch-inofix-contact-manager    文件:ContactServiceImpl.java   
@Override
public void deleteTempFileEntry(long groupId, String folderName, String fileName) throws PortalException {

    ContactManagerPortletPermission.check(getPermissionChecker(), groupId, ContactManagerActionKeys.EXPORT_IMPORT_CONTACTS);

    TempFileEntryUtil.deleteTempFileEntry(groupId, getUserId(),
            DigesterUtil.digestHex(Digester.SHA_256, folderName), fileName);
}
项目:ch-inofix-contact-manager    文件:ContactServiceImpl.java   
@Override
public String[] getTempFileNames(long groupId, String folderName) throws PortalException {

    ContactManagerPortletPermission.check(getPermissionChecker(), groupId, ContactManagerActionKeys.EXPORT_IMPORT_CONTACTS);

    return TempFileEntryUtil.getTempFileNames(groupId, getUserId(),
            DigesterUtil.digestHex(Digester.SHA_256, folderName));
}
项目:ch-inofix-data-manager    文件:MeasurementServiceImpl.java   
@Override
public String[] getTempFileNames(long groupId, String folderName)
        throws PortalException {

    DataManagerPortletPermission.check(getPermissionChecker(), groupId,
            MeasurementActionKeys.EXPORT_IMPORT_MEASUREMENTS);

    return TempFileEntryUtil.getTempFileNames(groupId, getUserId(),
            DigesterUtil.digestHex(Digester.SHA_256, folderName));
}
项目:lims    文件:Buddy.java   
/**
 * Factory method which creates new Buddy object from BuddyDetails
 *
 * @param buddyDetails BuddyDetails
 * @return User
 */
public static Buddy fromBuddyDetails(BuddyDetails buddyDetails) {
    // Create new buddy
    Buddy buddy = new Buddy();
    // Map data to user details
    buddy.buddyId = buddyDetails.getBuddyId();
    buddy.companyId = buddyDetails.getCompanyId();
    buddy.fullName = buddyDetails.getFullName();
    buddy.screenName = buddyDetails.getScreenName();
    buddy.password = buddyDetails.getPassword();

    // Add additional info from local service util if it's not set in buddy details
    if (buddyDetails.getBuddyId() != null) {
        try {
            User user = UserLocalServiceUtil.getUserById(buddyDetails.getBuddyId());
            if (buddy.screenName == null) {
                buddy.screenName = user.getScreenName();
            }

            if (buddy.companyId == null) {
                buddy.companyId = user.getCompanyId();
            }

            if (buddy.fullName == null) {
                buddy.fullName = user.getFullName();
            }

            buddy.male = user.getMale();
            buddy.portraitId = user.getPortraitId();
            buddy.portraitImageToken = HttpUtil.encodeURL(DigesterUtil.digest(user.getUserUuid()));
            buddy.portraitToken = WebServerServletTokenUtil.getToken(user.getPortraitId());
            buddy.fullName = user.getFullName();

        } catch (Exception e) {
            // Just log
            if (log.isDebugEnabled()) {
                log.debug(e);
            }
        }
    }

    // Relations
    if (buddyDetails.getPresenceDetails() != null) {
        buddy.presence = Presence.fromPresenceDetails(buddyDetails.getPresenceDetails());
    }

    if (buddyDetails.getSettingsDetails() != null) {
        buddy.settings = Settings.fromSettingsDetails(buddyDetails.getSettingsDetails());
    }

    return buddy;
}