List of usage examples for java.lang Long Long
@Deprecated(since = "9") public Long(String s) throws NumberFormatException
From source file:br.ufac.sion.converter.EstadoConverter.java
@Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (StringUtils.isBlank(value)) { return null; }// ww w. j a va 2 s.c om return this.estadoFacade.findById(new Long(value)); }
From source file:hu.jozsef.vesza.so.servlets.MealImageService.java
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Long mealId = new Long(request.getParameter("identifier")); Meal fetchedMeal = objectify.load().type(Meal.class).id(mealId).now(); if (fetchedMeal.getImage() != null) { String imageUrl = "/WEB-INF/" + fetchedMeal.getImage(); String imageRealPath = this.getServletContext().getRealPath(imageUrl); InputStream imgStream = new FileInputStream(new File(imageRealPath)); Blob image = new Blob(IOUtils.toByteArray(imgStream)); response.setContentType("image/jpeg"); response.getOutputStream().write(image.getBytes()); } else {//from w w w . j ava 2 s.c om response.getWriter().print("No image"); } }
From source file:com.oliveira.pedidovenda.converter.ClienteConverter.java
@Override public Object getAsObject(FacesContext context, UIComponent component, String value) { Cliente retorno = null;//from w ww . j a va2 s .co m if (StringUtils.isNotEmpty(value)) { //retorno = this.clientes.porId(new Long(value)); Long id = new Long(value); retorno = clientes.porId(id); } return retorno; }
From source file:hu.jozsef.vesza.so.servlets.EventImageService.java
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Long eventId = new Long(request.getParameter("identifier")); Event fetchedEvent = objectify.load().type(Event.class).id(eventId).now(); String imageUrl = "/WEB-INF/" + fetchedEvent.getShortTitle() + ".png"; String imageRealPath = this.getServletContext().getRealPath(imageUrl); InputStream imgStream = new FileInputStream(new File(imageRealPath)); Blob image = new Blob(IOUtils.toByteArray(imgStream)); if (image != null) { response.setContentType("image/jpeg"); response.getOutputStream().write(image.getBytes()); } else {/*from www . j a v a 2s .c o m*/ response.getWriter().write("no image"); } }
From source file:br.ufac.sion.converter.EmpresaConverter.java
@Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (StringUtils.isBlank(value)) { return null; }//from w w w. java2 s .c o m return this.empresaFacade.findById(new Long(value)); }
From source file:mx.um.edu.medicina.camposClinicos.service.impl.PlazaManagerImpl.java
/** * {@inheritDoc}//from w w w.java 2s . c o m */ @Override public Plaza getPlaza(final String plazaId) { return plazaDao.get(new Long(plazaId)); }
From source file:ispok.valid.SeriesNameValidator.java
@Override public void validate(FacesContext fc, UIComponent uic, Object o) throws ValidatorException { String string = (String) o; string = string.trim();// www . j a v a 2 s .c o m Object param = uic.getAttributes().get("seriesId"); Long id = new Long(0); if (param != null) { id = (Long) param; } if (string.length() < 4 || string.length() > 255) { throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, FacesUtil.getString("series_name_invalid"), FacesUtil.getString("series_name_invalid"))); } SeriesDto seriesTmp = seriesService.getByName(string); if (seriesTmp != null && !seriesTmp.getId().equals(id)) { throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, FacesUtil.getString("series_name_exist"), FacesUtil.getString("series_name_exist"))); } }
From source file:br.ufac.sion.converter.InscricaoConverter.java
@Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (StringUtils.isBlank(value)) { return null; }/*w w w .j av a 2s . c o m*/ return this.inscricaoFacade.findById(new Long(value)); }
From source file:br.ufac.sion.inscricao.converter.ConcursoConverter.java
@Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (StringUtils.isBlank(value)) { return null; }/* www . j av a 2s . c om*/ return this.concursoFacade.findById(new Long(value)); }
From source file:br.ufac.sion.converter.ConcursoConverter.java
@Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (StringUtils.isBlank(value)) { return null; }//w w w.j a v a2 s . com return this.concursoFacade.findConcursoWithCargo(new Long(value)); }