first commit
This commit is contained in:
commit
4d332ef662
27586 changed files with 3281783 additions and 0 deletions
43
rus/WEB-INF/lib/javax.mail_src/javax/mail/Quota.java
Normal file
43
rus/WEB-INF/lib/javax.mail_src/javax/mail/Quota.java
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package javax.mail;
|
||||
|
||||
public class Quota {
|
||||
public String quotaRoot;
|
||||
|
||||
public Resource[] resources;
|
||||
|
||||
public static class Resource {
|
||||
public String name;
|
||||
|
||||
public long usage;
|
||||
|
||||
public long limit;
|
||||
|
||||
public Resource(String name, long usage, long limit) {
|
||||
this.name = name;
|
||||
this.usage = usage;
|
||||
this.limit = limit;
|
||||
}
|
||||
}
|
||||
|
||||
public Quota(String quotaRoot) {
|
||||
this.quotaRoot = quotaRoot;
|
||||
}
|
||||
|
||||
public void setResourceLimit(String name, long limit) {
|
||||
if (this.resources == null) {
|
||||
this.resources = new Resource[1];
|
||||
this.resources[0] = new Resource(name, 0L, limit);
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < this.resources.length; i++) {
|
||||
if ((this.resources[i]).name.equalsIgnoreCase(name)) {
|
||||
(this.resources[i]).limit = limit;
|
||||
return;
|
||||
}
|
||||
}
|
||||
Resource[] ra = new Resource[this.resources.length + 1];
|
||||
System.arraycopy(this.resources, 0, ra, 0, this.resources.length);
|
||||
ra[ra.length - 1] = new Resource(name, 0L, limit);
|
||||
this.resources = ra;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue