Search in sources :

Example 71 with InvalidParameterException

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;
}
Also used : InvalidParameterException(java.security.InvalidParameterException)

Example 72 with InvalidParameterException

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];
}
Also used : InvalidParameterException(java.security.InvalidParameterException)

Example 73 with InvalidParameterException

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);
    }
}
Also used : InvalidParameterException(java.security.InvalidParameterException) Signature(java.security.Signature) MySignature1(org.apache.harmony.security.tests.support.MySignature1) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Example 74 with InvalidParameterException

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
    }
}
Also used : InvalidParameterException(java.security.InvalidParameterException) MySignature1(org.apache.harmony.security.tests.support.MySignature1)

Example 75 with InvalidParameterException

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();
    }
}
Also used : InvalidParameterException(java.security.InvalidParameterException) File(java.io.File)

Aggregations

InvalidParameterException (java.security.InvalidParameterException)135 SecureRandom (java.security.SecureRandom)15 ActionEvent (com.cloud.event.ActionEvent)11 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)11 IOException (java.io.IOException)10 ArrayList (java.util.ArrayList)10 Map (java.util.Map)10 LoadBalancerVO (com.cloud.network.dao.LoadBalancerVO)9 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)8 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)8 Paint (android.graphics.Paint)7 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)7 DB (com.cloud.utils.db.DB)7 File (java.io.File)7 Properties (java.util.Properties)7 NimbusClient (backtype.storm.utils.NimbusClient)6 FirewallRule (com.cloud.network.rules.FirewallRule)6 InvalidKeyException (java.security.InvalidKeyException)6 Time (android.text.format.Time)4 FileNotFoundException (java.io.FileNotFoundException)4