首页 > 编程知识 正文

java如何创建和使用组件,使用microsoftsway创建

时间:2023-05-06 08:50:20 阅读:246059 作者:1178

创建com.adobe.flashaccess.sdk.policy.Policy对象并指定其属性,包括权限、许可证缓存持续时间和DRM策略结束日期。

// Create a new DRM policy object.

// False indicates the DRM policy does not use license chaining.

Policy policy = new Policy(false);

policy.setName("DemoPolicy");

// Specify that the DRM policy requires authentication to obtain a license.

policy.setLicenseServerInfo(new LicenseServerInfo(AuthenticationType.UsernamePassword));

// A DRM policy must have at least one Right, typically the play right

PlayRight play = new PlayRight();

// Users can only view content for 24 hours.

play.setPlaybackWindow(24L * 60 * 60);

// Add the play right to the DRM policy.

List rightsList = new ArrayList();

rightsList.add(play);

policy.setRights(rightsList);

// Licenses can be stored on the client for 7 days after downloading

policy.setLicenseCachingDuration(7L * 24 * 60 * 60);

try {

// Content will expire December 31, 2010

SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

policy.setPolicyEndDate(dateFormat.parse("2010-12-31"));

} catch (ParseException e) {

// Invalid date specified in dateFormat.parse()

e.printStackTrace();

}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。