Examples of VirtualFile


Examples of org.jboss.virtual.VirtualFile

      }
    return new ClobImpl(new VirtualFileInputStreamFactory(f), -1);
    }
   
    public SQLXMLImpl getVDBResourceAsSQLXML(String resourcePath) {
      final VirtualFile f = getFile(resourcePath);
      if (f == null) {
        return null;
      }
    return new SQLXMLImpl(new VirtualFileInputStreamFactory(f));
    }
View Full Code Here

Examples of org.jboss.virtual.VirtualFile

      }
    return new SQLXMLImpl(new VirtualFileInputStreamFactory(f));
    }
   
    public BlobImpl getVDBResourceAsBlob(String resourcePath) {
      final VirtualFile f = getFile(resourcePath);
      if (f == null) {
        return null;
      }
      return new BlobImpl(new VirtualFileInputStreamFactory(f));
    }
View Full Code Here

Examples of org.richfaces.resource.optimizer.vfs.VirtualFile

                            new VersionKey(matcher.group(1), matcher.group(2)));
                }
            }
        }

        VirtualFile result;

        if (latestVersionKey != null) {
            result = file.getChild(latestVersionKey.toString());
        } else {
            result = file;
        }

        if (result != null && (library ^ result.isFile())) {
            return result;
        }

        return null;
    }
View Full Code Here

Examples of play.vfs.VirtualFile

    }

   
  @SuppressWarnings("unchecked")
  public static void loadModels(String name) {
    VirtualFile yamlFile = null;
    try  {
      for (VirtualFile vf : Play.javaPath) {
              yamlFile = vf.child(name);
              if (yamlFile != null && yamlFile.exists()) {
                  break;
              }
          }
          if (yamlFile == null) {
              throw new RuntimeException("Cannot load fixture " + name + ", the file was not found");
View Full Code Here

Examples of yalp.vfs.VirtualFile

            throw new RuntimeException(e);
        }
    }

    public void serveStatic(GrizzlyRequest grizzlyRequest, GrizzlyResponse grizzlyResponse, RenderStatic renderStatic) {
        VirtualFile file = Yalp.getVirtualFile(renderStatic.file);
        if (file == null || file.isDirectory() || !file.exists()) {
            serve404(grizzlyRequest, grizzlyResponse, new NotFound("The file " + renderStatic.file + " does not exist"));
        } else {
            grizzlyResponse.setContentType(MimeTypes.getContentType(file.getName()));
            boolean raw = false;
            for (YalpPlugin plugin : Yalp.plugins) {
                if (plugin.serveStatic(file, Request.current(), Response.current())) {
                    raw = true;
                    break;
                }
            }
            try {
                if (raw) {
                    copyResponse(Request.current(), Response.current(), grizzlyRequest, grizzlyResponse);
                } else {
                    if (Yalp.mode == Yalp.Mode.DEV) {
                        grizzlyResponse.setHeader("Cache-Control", "no-cache");
                        grizzlyResponse.setHeader("Content-Length", String.valueOf(file.length()));
                        if (!grizzlyRequest.getMethod().equals("HEAD")) {
                            copyStream(grizzlyResponse, file.inputstream());
                        } else {
                            copyStream(grizzlyResponse, new ByteArrayInputStream(new byte[0]));
                        }
                    } else {
                        long last = file.lastModified();
                        String etag = "\"" + last + "-" + file.hashCode() + "\"";
                        if (!isModified(etag, last, grizzlyRequest)) {
                            grizzlyResponse.setHeader("Etag", etag);
                            grizzlyResponse.setStatus(304);
                        } else {
                            grizzlyResponse.setHeader("Last-Modified", Utils.getHttpDateFormatter().format(new Date(last)));
                            grizzlyResponse.setHeader("Cache-Control", "max-age=" + Yalp.configuration.getProperty("http.cacheControl", "3600"));
                            grizzlyResponse.setHeader("Etag", etag);
                            copyStream(grizzlyResponse, file.inputstream());
                        }
                    }

                }
            } catch (IOException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.