📄 transferitem.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package org.openacs;import java.util.Calendar;import java.util.Random;/** * * @author Administrator */public class TransferItem { private static final long LIFE_TIME = 3600*1000; // lifetime in milis private long timeCreated; private String user; private String password; private Integer idHost; private int type; public final static int UPLOAD_LOG = 1; public final static int UPLOAD_CONFIG = 2; public final static int DOWNLOAD_CONFIG = 3; public TransferItem (int id, int type) { byte [] rb = new byte [8]; Random r = new Random (); r.nextBytes(rb); user = Integer.toHexString(id)+Util.cvtHex(rb); r.nextBytes(rb); password = Util.cvtHex(rb); this.type = type; idHost = id; timeCreated = Calendar.getInstance().getTimeInMillis();} public String getUser () { return user; } public String getPassword () { return password; } public Integer getHostId () { return idHost; } public boolean isExpired () { return (Calendar.getInstance().getTimeInMillis() - timeCreated >LIFE_TIME); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -