Example usage for java.lang IllegalAccessError IllegalAccessError

List of usage examples for java.lang IllegalAccessError IllegalAccessError

Introduction

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

Prototype

public IllegalAccessError(String s) 

Source Link

Document

Constructs an IllegalAccessError with the specified detail message.

Usage

From source file:cats.twitter.webapp.controller.module.ApiController.java

/**
 * Modules have to query here when they want to retrieve a corpus.
 * @param token The token sent in the initialisation request (/init)
 * @param from (not required) Pagination
 * @param to (not required) Pagination/*from   w ww  . j a  va 2s.  c o  m*/
 * @return The list of tweets of the corpus in JSON
 */
// @CrossOrigin(origins = "http://localhost:3000")
@RequestMapping(value = "/api", method = RequestMethod.GET)
public List<Tweet> api(@RequestHeader("token") String token,
        @RequestParam(value = "from", required = false) Integer from,
        @RequestParam(value = "to", required = false) Integer to) {
    Optional<Request> req = reqRepository.findOneByToken(token);
    if (!req.isPresent()) {
        throw new IllegalAccessError("Please verify your token!");
    }
    Corpus corpus = req.get().getCorpus();

    if (from == null)
        from = 0;
    if (to == null)
        to = Math.toIntExact(tweetRepository.countByCorpusId(corpus.getId()));

    return tweetRepository.findByCorpusId(corpus.getId(), new ChunkRequest(from, to - from)).getContent();

}

From source file:com.neoprojectmanager.model.Task.java

public void setName(String name) {
    if (isBlank(name))
        throw new IllegalAccessError("Name can not be blank");
    setProperty(PROPERTY.NAME, name);/* w  w  w. j av a  2 s . c o  m*/
}

From source file:com.netfinworks.rest.convert.MultiPartFormDataParamConvert.java

@Override
public <T> T convert(String paramString, Class<T> paramClass) {
    throw new IllegalAccessError("multipart form can't convert by string.");
}

From source file:com.tzutalin.configio.JsonConfig.java

@Override
public boolean loadFromFile() {
    // If it has loaed to memory, return true directly
    if (mbLoadToMemory == true) {
        return true;
    }/* ww w  .  ja v a  2 s .co m*/

    if (TextUtils.isEmpty(mTargetPath)) {
        throw new IllegalAccessError("Empty file path");
    }

    if (new File(mTargetPath).exists()) {
        try {
            File f = new File(mTargetPath);
            FileInputStream is = new FileInputStream(f);
            int size = is.available();
            byte[] buffer = new byte[size];
            is.read(buffer);
            is.close();
            String response = new String(buffer);
            JSONObject jsonObj = new JSONObject(response);
            Map map = toMap(jsonObj);
            map.putAll(mMap);
            mMap = map;
            // Print log
            dumpMap();
            mbLoadToMemory = true;
        } catch (IOException e) {
            e.printStackTrace();
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    return mbLoadToMemory;
}

From source file:com.twitt4droid.Twitt4droid.java

/**
 * Default constructor. Do NOT try to initialize this class, it is suppose
 * to be an static utility.//from  ww  w. ja  v  a 2s  .  c o m
 */
private Twitt4droid() {
    throw new IllegalAccessError("This class cannot be instantiated nor extended");
}

From source file:cn.code.notes.gtask.data.MetaData.java

@Override
public void setContentByLocalJSON(JSONObject js) {
    // this function should not be called
    throw new IllegalAccessError("MetaData:setContentByLocalJSON should not be called");
}

From source file:com.scf.web.context.WebContext.java

/**
 *
 * @return//from   w  w  w  .ja  v  a2 s  .c om
 */
public String getWebRootPath() {
    if (WEB_ROOT_PATH == null) {
        try {
            Resource resource = new ServletContextResource(getServletContext(), "/");
            WEB_ROOT_PATH = resource.getFile().getAbsolutePath();
            if (WEB_ROOT_PATH == null) {
                WEB_ROOT_PATH = resource.getFile().getAbsoluteFile().getAbsolutePath();
            }
            WEB_ROOT_PATH = FileUtilies.fixPath(WEB_ROOT_PATH);
            WEB_ROOT_PATH += "/";
        } catch (NullPointerException e1) {
            throw new IllegalAccessError("Can not init system root path. please check.");
        } catch (IOException e2) {
            throw new IllegalAccessError("Can not init system root path. please check.");
        }
    }
    return WEB_ROOT_PATH;
}

From source file:edu.utah.further.i2b2.hook.further.web.ServletUtil.java

/**
 * <p>//from  w w  w  . j av  a2s.c  om
 * Hide constructor in utility class.
 * </p>
 */
private ServletUtil() {
    throw new IllegalAccessError("A utility class cannot be instantiated");
}

From source file:com.clueride.dao.FileImageStore.java

/**
 * There is an opportunity to build a cache of the contents of each directory,
 * but for now, this only builds a cache of the locations' directories.
 *///  www  .jav  a  2  s.  com
private void initialize() {
    if (!BASE_DIR.canWrite()) {
        throw new IllegalAccessError("Unable to write to Image Datastore");
    }

    for (File locDir : BASE_DIR.listFiles()) {
        try {
            Integer locId = Integer.parseInt(locDir.getName());
            locationDirectories.put(locId, locDir);
        } catch (NumberFormatException nfe) {
            LOGGER.warn("Unexpected entry in image directory: " + locDir.getName());
        }
    }

}

From source file:org.codehaus.mojo.cassandra.Utils.java

/**
 * Do not instantiate.
 */
private Utils() {
    throw new IllegalAccessError("Utility class");
}