1
0
mirror of https://github.com/Rogiel/httpchannel synced 2025-12-05 23:22:51 +00:00

Adds service implementation documentation

This commit is contained in:
2012-01-18 17:13:36 -02:00
parent f8d5303f70
commit 35e2c2fc56
22 changed files with 754 additions and 11 deletions

View File

@@ -0,0 +1,25 @@
/**
*
*/
package com.rogiel.httpchannel.service;
import com.rogiel.httpchannel.service.Authenticator.AuthenticatorConfiguration;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
public class AbstractAuthenticatorConfiguration implements
AuthenticatorConfiguration {
@Override
public boolean is(Class<? extends AuthenticatorConfiguration> type) {
return type.isAssignableFrom(this.getClass());
}
@Override
public <T extends AuthenticatorConfiguration> T as(Class<T> type) {
if (!is(type))
return null;
return type.cast(this);
}
}

View File

@@ -0,0 +1,24 @@
/**
*
*/
package com.rogiel.httpchannel.service;
import com.rogiel.httpchannel.service.Downloader.DownloaderConfiguration;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
public class AbstractDownloaderConfiguration implements DownloaderConfiguration {
@Override
public boolean is(Class<? extends DownloaderConfiguration> type) {
return type.isAssignableFrom(this.getClass());
}
@Override
public <T extends DownloaderConfiguration> T as(Class<T> type) {
if (!is(type))
return null;
return type.cast(this);
}
}

View File

@@ -0,0 +1,24 @@
/**
*
*/
package com.rogiel.httpchannel.service;
import com.rogiel.httpchannel.service.Uploader.UploaderConfiguration;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
public class AbstractUploaderConfiguration implements UploaderConfiguration {
@Override
public boolean is(Class<? extends UploaderConfiguration> type) {
return type.isAssignableFrom(this.getClass());
}
@Override
public <T extends UploaderConfiguration> T as(Class<T> type) {
if (!is(type))
return null;
return type.cast(this);
}
}

View File

@@ -0,0 +1,22 @@
/**
*
*/
package com.rogiel.httpchannel.util;
/**
* @author <a href="http://www.rogiel.com">Rogiel</a>
*
*/
public class Filesizes {
public static long kb(long kb) {
return kb * 1024;
}
public static long mb(long mb) {
return kb(mb) * 1024;
}
public static long gb(long gb) {
return mb(gb) * 1024;
}
}