Example usage for java.util.logging Level WARNING

List of usage examples for java.util.logging Level WARNING

Introduction

In this page you can find the example usage for java.util.logging Level WARNING.

Prototype

Level WARNING

To view the source code for java.util.logging Level WARNING.

Click Source Link

Document

WARNING is a message level indicating a potential problem.

Usage

From source file:com.amour.imagecrawler.ImagesManager.java

/**
 * Load images Urls from external collection
 * @param externalImagesUrl The image Urls to load
 *//*  w  w  w . ja v a 2 s  .  co m*/
public void loadExternalImages(List<String> externalImagesUrl) {
    for (String imageUrl : externalImagesUrl) {
        if (!this.imagesList.contains(imageUrl)) {
            this.imagesList.add(imageUrl);
        } else {
            Logger.getLogger(Crawler.class.getName()).log(Level.WARNING, "Dupplicate entry");
        }
    }
}

From source file:com.microsoftopentechnologies.windowsazurestorage.helper.CredentialMigration.java

/**
 *
 * Take the legacy local storage credential configuration and create an
 * equivalent global credential in Jenkins Credential Store
 *
 *//*from w  w  w.  ja v  a  2 s . com*/
private static void removeFile(String sourceFile) throws IOException {
    File file = new File(sourceFile);

    if (file.delete()) {
        LOGGER.log(Level.INFO, file.getName() + " is deleted!");
    } else {
        LOGGER.log(Level.WARNING, file.getName() + "deletion is failed.");
    }
}

From source file:com.sappenin.utils.appengine.tasks.aggregate.AbstractAggregatingTaskScheduler.java

@Override
public TaskHandle schedule(final T payload) {
    try {// ww  w .j av  a 2 s. c  o  m
        super.schedule(payload);
    } catch (TaskAlreadyExistsException e) {
        // Do nothing - eat this exception!  If the task already exists, it simply means we're aggregating
        // properly.
        getLogger().log(Level.WARNING,
                "Tried to schedule AggregateNotification Task with name: " + payload == null ? "unkown"
                        : payload.getAggregatedTaskName(),
                e);

    } catch (RuntimeException re) {
        // Usually, the TaskAlreadyExistsException is inside of a RuntimeException
        if (TaskAlreadyExistsException.class.isAssignableFrom(re.getCause().getClass())) {
            // Do nothing - eat this exception!  If the task already exists, it simply means we're aggregating
            // properly.
            getLogger().log(Level.WARNING,
                    "Tried to schedule AggregateNotification Task with name: " + payload == null ? "unkown"
                            : payload.getAggregatedTaskName(),
                    re);
        } else {
            throw re;
        }
    }
    return null;
}

From source file:com.google.youtube.captions.AuthSubLogin.java

@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    try {/*from www  . j  a v  a 2 s .c o  m*/
        String authSubToken = AuthSubUtil.getTokenFromReply(req.getQueryString());
        if (authSubToken == null) {
            throw new IllegalStateException("Could not parse token from AuthSub response.");
        } else {
            authSubToken = URLDecoder.decode(authSubToken, "UTF-8");
        }

        authSubToken = AuthSubUtil.exchangeForSessionToken(authSubToken, null);

        YouTubeService service = new YouTubeService(SystemProperty.applicationId.get(), Util.DEVELOPER_KEY);
        service.setAuthSubToken(authSubToken);

        UserProfileEntry profileEntry = service.getEntry(new URL(PROFILE_URL), UserProfileEntry.class);
        String username = profileEntry.getUsername();

        String authSubCookie = Util.getCookie(req, Util.AUTH_SUB_COOKIE);
        JSONObject cookieAsJSON = new JSONObject();
        if (!Util.isEmptyOrNull(authSubCookie)) {
            try {
                cookieAsJSON = new JSONObject(authSubCookie);
            } catch (JSONException e) {
                LOG.log(Level.WARNING, "Unable to parse JSON from the existing cookie: " + authSubCookie, e);
            }
        }

        try {
            cookieAsJSON.put(username, authSubToken);
        } catch (JSONException e) {
            LOG.log(Level.WARNING,
                    String.format("Unable to add account '%s' and AuthSub token '%s'" + " to the JSON object.",
                            username, authSubToken),
                    e);
        }

        Cookie cookie = new Cookie(Util.AUTH_SUB_COOKIE, cookieAsJSON.toString());
        cookie.setMaxAge(Util.COOKIE_LIFETIME);
        resp.addCookie(cookie);

        cookie = new Cookie(Util.CURRENT_AUTHSUB_TOKEN, authSubToken);
        cookie.setMaxAge(Util.COOKIE_LIFETIME);
        resp.addCookie(cookie);

        cookie = new Cookie(Util.CURRENT_USERNAME, username);
        cookie.setMaxAge(Util.COOKIE_LIFETIME);
        resp.addCookie(cookie);
    } catch (IllegalStateException e) {
        LOG.log(Level.WARNING, "", e);
    } catch (AuthenticationException e) {
        LOG.log(Level.WARNING, "", e);
    } catch (GeneralSecurityException e) {
        LOG.log(Level.WARNING, "", e);
    } catch (ServiceException e) {
        LOG.log(Level.WARNING, "", e);
    }

    resp.sendRedirect("/");
}

From source file:org.geonode.security.GeoNodeAnonymousProcessingFilter.java

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {

    final SecurityContext securityContext = SecurityContextHolder.getContext();
    final Authentication existingAuth = securityContext.getAuthentication();

    final boolean authenticationRequired = existingAuth == null || !existingAuth.isAuthenticated();

    if (authenticationRequired) {
        try {//from   w  w  w . j a va  2s  .  c o m
            Object principal = existingAuth == null ? null : existingAuth.getPrincipal();
            Collection<? extends GrantedAuthority> authorities = existingAuth == null ? null
                    : existingAuth.getAuthorities();
            Authentication authRequest = new AnonymousGeoNodeAuthenticationToken(principal, authorities);
            final Authentication authResult = getSecurityManager().authenticate(authRequest);
            securityContext.setAuthentication(authResult);
            LOGGER.finer("GeoNode Anonymous filter kicked in.");
        } catch (AuthenticationException e) {
            // we just go ahead and fall back on basic authentication
            LOGGER.log(Level.WARNING, "Error connecting to the GeoNode server for authentication purposes", e);
        }
    }

    // move forward along the chain
    chain.doFilter(request, response);
}

From source file:ca.sfu.federation.Application.java

/**
 * Start the application./* w  w  w  .  j  a  v  a  2 s . c  o  m*/
 */
@Override
public void run() {
    logger.log(Level.INFO, "Starting application");
    // set the look and feel options
    try {
        logger.log(Level.FINE, "Setting look and feel options");
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        JPopupMenu.setDefaultLightWeightPopupEnabled(false);
        LookAndFeelUtil.removeAllSplitPaneBorders();
    } catch (Exception e) {
        String stack = ExceptionUtils.getFullStackTrace(e);
        logger.log(Level.WARNING, "Could not set look and feel options\n\n{0}", stack);
    }
    // create the main application frame 
    logger.log(Level.FINE, "Creating main application frame");
    frame = new ApplicationFrame();
    // show the application
    frame.setVisible(true);
}

From source file:fr.pasteque.pos.sales.DataLogicReceipts.java

public final TicketInfo getSharedTicket(String id) throws BasicException {
    if (CallQueue.isOffline()) {
        // Read from cache until recovery
        SharedTicketInfo stkt = TicketsCache.getTicket(id);
        if (stkt != null) {
            return stkt.getTicket();
        } else {//  w w  w. ja  v a2s .c o m
            return null;
        }
    }
    try {
        ServerLoader loader = new ServerLoader();
        ServerLoader.Response r = loader.read("TicketsAPI", "getShared", "id", id);
        if (r.getStatus().equals(ServerLoader.Response.STATUS_OK)) {
            JSONObject o = r.getObjContent();
            if (o == null) {
                return null;
            }
            // Ticket read from server, cache it
            SharedTicketInfo stkt = new SharedTicketInfo(o);
            try {
                TicketsCache.saveTicket(stkt);
            } catch (BasicException e) {
                e.printStackTrace();
            }
            return stkt.getTicket();
        } else {
            return null;
        }
    } catch (Exception e) {
        logger.log(Level.WARNING, "Failed to load shared ticket " + id + " from server: " + e.getMessage());
        // Unable to read it from server, try reading from cache
        SharedTicketInfo stkt = TicketsCache.getTicket(id);
        if (stkt != null) {
            return stkt.getTicket();
        } else {
            return null;
        }
    }
}

From source file:org.osiam.addons.selfadministration.exception.OsiamExceptionHandler.java

@ExceptionHandler(OsiamException.class)
protected ModelAndView handleException(OsiamException ex, HttpServletResponse response) {
    LOGGER.log(Level.WARNING, AN_EXCEPTION_OCCURED, ex);
    response.setStatus(ex.getHttpStatusCode());
    modelAndView.addObject(KEY, ex.getKey());
    setLoggingInformation(ex);/*from   w  w w .  ja v a 2s  .  c o  m*/
    return modelAndView;
}

From source file:tanks10.SendAndReceive.java

private void closeSession() throws RuntimeException {
    try {/*  w  w  w .j  a  va2 s  .  com*/
        closed = true;
        protocol.connectionLost();
        session.close();
    } catch (Exception e) {
        LOG.log(Level.WARNING, "close session failed for " + session.getRemoteAddress().toString(), e);
    }
}

From source file:com.neophob.sematrix.core.osc.PixelControllerOscServer.java

@Override
public void handleOscMessage(OscMessage oscIn) {
    //sanity check
    if (StringUtils.isBlank(oscIn.getPattern())) {
        LOG.log(Level.INFO, "Ignore empty OSC message...");
        return;//  w  w  w  .j  a  v a2 s  .co m
    }

    String pattern = oscIn.getPattern();

    ValidCommands command;
    try {
        command = ValidCommands.valueOf(pattern);
    } catch (Exception e) {
        LOG.log(Level.WARNING, "Unknown message: " + pattern, e);
        return;
    }

    String[] msg = new String[1 + command.getNrOfParams()];
    msg[0] = pattern;

    if (oscIn.getBlob() == null && command.getNrOfParams() > 0
            && command.getNrOfParams() != oscIn.getArgs().length) {
        String args = oscIn.getArgs() == null ? "null" : "" + oscIn.getArgs().length;
        LOG.log(Level.WARNING, "Parameter cound missmatch, expected: {0} available: {1} ",
                new String[] { "" + command.getNrOfParams(), "" + args });
        return;
    }

    //ignore nr of parameter for osc generator
    if (command != ValidCommands.OSC_GENERATOR1 && command != ValidCommands.OSC_GENERATOR2) {
        for (int i = 0; i < command.getNrOfParams(); i++) {
            msg[1 + i] = oscIn.getArgs()[i];
        }
    }

    LOG.log(Level.INFO, "Recieved OSC message: {0}", msg);
    MessageProcessor.processMsg(msg, true, oscIn.getBlob());

    //notfiy gui if an osc message arrives
    Collector.getInstance().notifyGuiUpdate();
}