use of java.security.InvalidParameterException in project UltimateAndroid by cymcsg.
the class WaterDropDrawable method setColorSchemeColors.
@Override
public void setColorSchemeColors(int[] colorSchemeColors) {
if (colorSchemeColors == null || colorSchemeColors.length < 4)
throw new InvalidParameterException("The color scheme length must be 4");
mPaint.setColor(colorSchemeColors[0]);
mColorSchemeColors = colorSchemeColors;
}
use of java.security.InvalidParameterException in project UltimateAndroid by cymcsg.
the class CirclesDrawable method initColors.
private void initColors(int[] colors) {
if (colors == null || colors.length < 4)
throw new InvalidParameterException("The color scheme length must be 4");
mColor1 = colors[0];
mColor2 = colors[1];
mColor3 = colors[2];
mColor4 = colors[3];
}
use of java.security.InvalidParameterException in project j2objc by google.
the class SignatureTest method testSetParameterStringObject.
/*
* Class under test for void setParameter(String, Object)
*/
@SuppressWarnings("deprecation")
public void testSetParameterStringObject() {
MySignature1 s = new MySignature1("ABC");
s.setParameter("aaa", new Object());
try {
Signature sig = getTestSignature();
sig.setParameter("TestParam", new Integer(42));
fail("expected InvalidParameterException");
} catch (InvalidParameterException e) {
// expected
} catch (NoSuchAlgorithmException e) {
fail("unexpected: " + e);
}
}
use of java.security.InvalidParameterException in project j2objc by google.
the class SignatureTest method testGetParameter.
@SuppressWarnings("deprecation")
public void testGetParameter() {
MySignature1 s = new MySignature1("ABC");
s.getParameter("aaa");
try {
MySignature se = new MySignature();
se.getParameter("test");
} catch (InvalidParameterException e) {
// ok
}
}
use of java.security.InvalidParameterException in project FileDownloader by lingochamp.
the class DownloadTaskHunter method prepare.
private void prepare() {
final BaseDownloadTask.IRunningTask runningTask = mTask.getRunningTask();
final BaseDownloadTask origin = runningTask.getOrigin();
if (origin.getPath() == null) {
origin.setPath(FileDownloadUtils.getDefaultSaveFilePath(origin.getUrl()));
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog.d(this, "save Path is null to %s", origin.getPath());
}
}
final File dir;
if (origin.isPathAsDirectory()) {
dir = new File(origin.getPath());
} else {
final String dirString = FileDownloadUtils.getParent(origin.getPath());
if (dirString == null) {
throw new InvalidParameterException(FileDownloadUtils.formatString("the provided mPath[%s] is invalid," + " can't find its directory", origin.getPath()));
}
dir = new File(dirString);
}
if (!dir.exists()) {
//noinspection ResultOfMethodCallIgnored
dir.mkdirs();
}
}
Aggregations