VisalloResourceNotFoundException
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.visallo.core.exception.VisalloResourceNotFoundException (Showing top 20 results out of 315)

origin: org.visallo/visallo-core

public static File resolveLocalFileName(String fileName) {
  List<File> configDirectories = getVisalloDirectoriesFromMostPriority("config");
  if (configDirectories.size() == 0) {
    throw new VisalloResourceNotFoundException("Could not find any valid config directories.");
  }
  for (File directory : configDirectories) {
    File f = new File(directory, fileName);
    if (f.exists()) {
      return f;
    }
  }
  throw new VisalloResourceNotFoundException("Could not find file: " + fileName);
}
origin: org.visallo/visallo-web

private void handleNotFound(HttpServletResponse response, VisalloResourceNotFoundException notFoundException) throws IOException {
  response.sendError(HttpServletResponse.SC_NOT_FOUND, notFoundException.getMessage());
}
origin: org.visallo/visallo-model-vertexium

@Override
public byte[] getMapGlyphIcon() {
  try {
    StreamingPropertyValue spv = OntologyProperties.MAP_GLYPH_ICON.getPropertyValue(getVertex());
    if (spv == null) {
      return null;
    }
    return IOUtils.toByteArray(spv.getInputStream());
  } catch (IOException e) {
    throw new VisalloResourceNotFoundException("Could not retrieve map glyph icon");
  }
}
origin: org.visallo/visallo-model-vertexium

@Override
public byte[] getGlyphIconSelected() {
  try {
    StreamingPropertyValue spv = OntologyProperties.GLYPH_ICON_SELECTED.getPropertyValue(getVertex());
    if (spv == null) {
      return null;
    }
    return IOUtils.toByteArray(spv.getInputStream());
  } catch (IOException e) {
    throw new VisalloResourceNotFoundException("Could not retrieve glyph icon selected");
  }
}
origin: org.visallo/visallo-model-vertexium

@Override
public byte[] getGlyphIcon() {
  try {
    StreamingPropertyValue spv = OntologyProperties.GLYPH_ICON.getPropertyValue(getVertex());
    if (spv == null) {
      return null;
    }
    return IOUtils.toByteArray(spv.getInputStream());
  } catch (IOException e) {
    throw new VisalloResourceNotFoundException("Could not retrieve glyph icon");
  }
}
origin: org.visallo/visallo-web

  @Handle
  public ClientApiProducts handle(
      @ActiveWorkspaceId String workspaceId,
      User user
  ) throws Exception {
    Collection<Product> products = workspaceRepository.findAllProductsForWorkspace(workspaceId, user);
    if (products == null) {
      throw new VisalloResourceNotFoundException("Could not find products for workspace " + workspaceId);
    }

    List<String> types = InjectHelper.getInjectedServices(WorkProductService.class, configuration).stream()
        .map(WorkProductService::getKind)
        .collect(Collectors.toList());

    return ClientApiConverter.toClientApiProducts(types, products);
  }
}
origin: org.visallo/visallo-web

  @Handle
  public DirectoryEntity handle(
      @Required(name = "id", allowEmpty = false) String id,
      User user
  ) {
    DirectoryEntity directoryEntity = this.directoryRepository.findById(id, user);
    if (directoryEntity == null) {
      throw new VisalloResourceNotFoundException("Could not find directory entry with id: " + id);
    }

    return directoryEntity;
  }
}
origin: org.visallo/visallo-core

protected void doConfigureLog4j() {
  String fileName = System.getProperty("logQuiet") == null ? "log4j2.xml" : "log4j2-quiet.xml";
  File log4jFile = null;
  String log4jLocation = null;
  try {
    log4jFile = resolveFileName(fileName);
  } catch (VisalloResourceNotFoundException e) {
    // OK, try classpath
  }
  if (log4jFile == null || !log4jFile.exists()) {
    URL log4jResource = getClass().getResource(fileName);
    System.err.println("Could not resolve log4j2.xml, using the fallback: " + log4jResource);
    try {
      if (log4jResource != null) {
        Configurator.initialize((String)null, null, log4jResource.toURI());
        log4jLocation = log4jResource.toExternalForm();
      } else {
        throw new VisalloResourceNotFoundException("Could not find log4j2.xml on the classpath");
      }
    } catch (URISyntaxException e) {
      throw new VisalloException("Unable to load default log42.xml", e);
    }
  } else {
    log4jLocation = log4jFile.getAbsolutePath();
    Configurator.initialize((String)null, null, log4jFile.toURI());
  }
  VisalloLogger logger = VisalloLoggerFactory.getLogger(VisalloLoggerFactory.class);
  logger.info("Using ConfigurationLoader: %s", this.getClass().getName());
  logger.info("Using log4j2.xml: %s", log4jLocation);
}
origin: org.visallo/visallo-core

throw new VisalloResourceNotFoundException("Could not resize image", e);
origin: org.visallo/visallo-web

  response.setContentType("text/html");
} else {
  throw new VisalloResourceNotFoundException("Only js,ejs,css,html files served from plugin");
  throw new VisalloResourceNotFoundException("Could not find file: " + filePath);
origin: org.visallo/visallo-core

throw new VisalloResourceNotFoundException("Error reading InputStream");
origin: org.visallo/visallo-web

  @Handle
  public void handle(
      @Required(name = "id") String id,
      User user
  ) throws Exception {
    ClientApiSearch savedSearch = this.searchRepository.getSavedSearch(id, user);
    if (savedSearch == null) {
      throw new VisalloResourceNotFoundException("Could not find saved search with id " + id);
    }

    this.searchRepository.deleteSearch(id, user);
  }
}
origin: org.visallo/visallo-web

  @Handle
  public ClientApiDashboards handle(
      @ActiveWorkspaceId String workspaceId,
      User user
  ) throws Exception {
    Collection<Dashboard> dashboards = workspaceRepository.findAllDashboardsForWorkspace(workspaceId, user);
    if (dashboards == null) {
      throw new VisalloResourceNotFoundException("Could not find dashboards for workspace " + workspaceId);
    }
    return ClientApiConverter.toClientApiDashboards(dashboards);
  }
}
origin: org.visallo/visallo-web

  @Handle
  public ClientApiEdge handle(
      @Required(name = "graphEdgeId") String graphEdgeId,
      @ActiveWorkspaceId String workspaceId,
      Authorizations authorizations
  ) throws Exception {
    Edge edge = graph.getEdge(graphEdgeId, authorizations);
    if (edge == null) {
      throw new VisalloResourceNotFoundException("Could not find edge: " + graphEdgeId);
    }

    Vertex outVertex = edge.getVertex(Direction.OUT, authorizations);
    if (outVertex == null) {
      throw new VisalloResourceNotFoundException("Could not find outVertex: " + edge.getVertexId(Direction.OUT));
    }

    Vertex inVertex = edge.getVertex(Direction.IN, authorizations);
    if (inVertex == null) {
      throw new VisalloResourceNotFoundException("Could not find inVertex: " + edge.getVertexId(Direction.IN));
    }

    return ClientApiConverter.toClientApiEdgeWithVertexData(edge, outVertex, inVertex, workspaceId, authorizations);
  }
}
origin: org.visallo/visallo-web

  @Handle
  public ClientApiSearch handle(
      @Required(name = "id") String id,
      @ActiveWorkspaceId String workspaceId,
      User user
  ) throws Exception {
    ClientApiSearch search = this.searchRepository.getSavedSearchOnWorkspace(id, user, workspaceId);

    if (search == null) {
      throw new VisalloResourceNotFoundException("Could not find search with id: " + id);
    }

    return search;
  }
}
origin: org.visallo/visallo-web

  @Handle
  public ClientApiWorkspaceDiff handle(
      @ActiveWorkspaceId String workspaceId,
      FormulaEvaluator.UserContext userContext,
      User user
  ) throws Exception {
    Workspace workspace = workspaceRepository.findById(workspaceId, true, user);
    if (workspace == null) {
      throw new VisalloResourceNotFoundException("Cannot find workspace: " + workspaceId);
    }

    return this.workspaceRepository.getDiff(workspace, user, userContext);
  }
}
origin: org.visallo/visallo-web-plugins-admin-user-tools

  @Handle
  public ClientApiSuccess handle(
      @Required(name = "workspaceId") String workspaceId,
      @Required(name = "user-name") String userName,
      User me
  ) throws Exception {
    User user = userRepository.findByUsername(userName);
    if (user == null) {
      throw new VisalloResourceNotFoundException("Could not find user: " + userName);
    }

    Workspace workspace = workspaceRepository.findById(workspaceId, user);
    if (workspace == null) {
      throw new VisalloResourceNotFoundException("Could not find workspace: " + workspaceId);
    }

    workspaceRepository.updateUserOnWorkspace(workspace, me.getUserId(), WorkspaceAccess.WRITE, user);

    return VisalloResponse.SUCCESS;
  }
}
origin: org.visallo/visallo-web

@Handle
public ClientApiDetectedObjects handle(
    @Required(name = "graphVertexId") String graphVertexId,
    @Required(name = "propertyName") String propertyName,
    @Required(name = "workspaceId") String workspaceId,
    Authorizations authorizations
) throws Exception {
  Vertex vertex = graph.getVertex(graphVertexId, authorizations);
  if (vertex == null) {
    throw new VisalloResourceNotFoundException(String.format("vertex %s not found", graphVertexId));
  }
  ClientApiDetectedObjects detectedObjects = new ClientApiDetectedObjects();
  Iterable<Property> detectedObjectProperties = vertex.getProperties(propertyName);
  if (detectedObjectProperties == null || IterableUtils.count(detectedObjectProperties) == 0) {
    throw new VisalloResourceNotFoundException(String.format("property %s not found on vertex %s", propertyName, vertex.getId()));
  }
  detectedObjects.addDetectedObjects(ClientApiConverter.toClientApiProperties(detectedObjectProperties, workspaceId));
  return detectedObjects;
}
origin: org.visallo/visallo-web

  @Handle
  public ClientApiVertex handle(
      @Required(name = "graphVertexId") String graphVertexId,
      @ActiveWorkspaceId String workspaceId,
      Authorizations authorizations
  ) throws Exception {
    Vertex vertex = graph.getVertex(graphVertexId, authorizations);
    if (vertex == null) {
      throw new VisalloResourceNotFoundException("Could not find vertex: " + graphVertexId);
    }
    return (ClientApiVertex) ClientApiConverter.toClientApi(vertex, workspaceId, authorizations);
  }
}
origin: org.visallo/visallo-web

  @Handle
  public ClientApiSuccess handle(
      @Required(name = "notificationId") String notificationId,
      User user
  ) throws Exception {
    SystemNotification notification = systemNotificationRepository.getNotification(notificationId, user);
    if (notification == null) {
      throw new VisalloResourceNotFoundException("Could not find notification with id: " + notificationId);
    }

    systemNotificationRepository.endNotification(notification, user);
    workQueueRepository.pushSystemNotificationEnded(notificationId);
    return VisalloResponse.SUCCESS;
  }
}
org.visallo.core.exceptionVisalloResourceNotFoundException

Most used methods

  • <init>
  • getMessage

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • IsNull (org.hamcrest.core)
    Is the value null?

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)