Example usage for java.lang SecurityException SecurityException

List of usage examples for java.lang SecurityException SecurityException

Introduction

In this page you can find the example usage for java.lang SecurityException SecurityException.

Prototype

public SecurityException(Throwable cause) 

Source Link

Document

Creates a SecurityException with the specified cause and a detail message of (cause==null ?

Usage

From source file:YourOwnProvider.java

public static final synchronized void verifyForJCE() {
    throw new SecurityException("Can't verify for JCE");
}

From source file:Main.java

@Override
public void checkAccess(Thread t) {
    throw new SecurityException("Not allowed.");
}

From source file:Main.java

@Override
public void checkExit(int status) {
    throw new SecurityException("Not allowed.");
}

From source file:Main.java

@Override
public void checkAccess(ThreadGroup a) {
    throw new SecurityException("Not allowed.");
}

From source file:org.globus.gsi.util.FileUtil.java

public static File createFile(String filename) throws IOException {

    File f = new File(filename);
    if (!f.createNewFile()) {
        FileUtils.forceDelete(f);/*w w w  . ja  va 2 s . c o m*/
        if (!f.createNewFile()) {
            throw new SecurityException("Failed to atomically create new file");
        }
    }
    return f;
}

From source file:CustomSecurityManager.java

public void checkRead(String fileName) {
    if (fileName != null && fileName.endsWith(".java")) {
        throw new SecurityException(" You are not allowed to read " + " file names ending with .java");
    }//from  w w w .j  av a 2s  .  c o m
    super.checkRead(fileName);
}

From source file:com.dgq.utils.EncodeUtils.java

/**
 * Hex?./*w  w  w. jav  a2s.c om*/
 */
public static byte[] decodeHex(String input) {
    try {
        return Hex.decodeHex(input.toCharArray());
    } catch (DecoderException e) {
        throw new SecurityException("Hex?!");
    }
}

From source file:nl.surfnet.coin.teams.util.TokenUtil.java

public static void checkTokens(String sessionToken, String token, SessionStatus status) {
    if (StringUtils.length(sessionToken) != TOKEN_LENGTH || !(sessionToken.equals(token))) {
        status.setComplete();//  w w  w  .  j av  a2  s.co  m
        throw new SecurityException("Token does not match");
    }
}

From source file:MainClass.java

public void checkRead(String file) {
    if (!(file.endsWith(".txt")) && !(file.endsWith(".java")) && !(file.endsWith(".class"))
            && !(file.startsWith("C:\\"))) {
        throw new SecurityException("No Read Permission for : " + file);
    }//w w  w. jav a2s.c  om
}

From source file:CustomSecurityManager.java

public void checkWrite(String fileName) {
    if (fileName != null && fileName.endsWith(".java")) {
        throw new SecurityException(" You are not allowed to write " + " file names ending with .java");
    }/*from   w w w. ja v a 2s  .co m*/
    super.checkWrite(fileName);
}