Examples of FileResource


Examples of com.jamierf.dropwizard.debpkg.resource.FileResource

    }

    @SuppressWarnings("OctalInteger")
    protected Collection<Resource> buildResourceList() {
        return ImmutableList.<Resource>builder()
                .add(new FileResource(configTemplate, true, path.getConfigFile(), unix.getUser(), unix.getUser(), UNIX_MODE_USER_ONLY))
                .add(new EmbeddedResource("/files/jvm.conf", true, path.getJvmConfigFile(), "root", "root", TarEntry.DEFAULT_FILE_MODE))
                .add(new EmbeddedResource("/files/upstart.conf", true, path.getUpstartFile(), "root", "root", TarEntry.DEFAULT_FILE_MODE))
                .add(new EmbeddedResource("/files/sysvinit.sh", true, path.getSysVinitFile(), "root", "root", TarEntry.DEFAULT_FILE_MODE | 0100111))
                .add(new EmbeddedResource("/files/start.sh", true, path.getStartScript(), "root", "root", TarEntry.DEFAULT_FILE_MODE | 0100111))
                .add(new FileResource(artifactFile, false, path.getJarFile(), unix.getUser(), unix.getUser(), TarEntry.DEFAULT_FILE_MODE))
                .addAll(Collections2.transform(files, new ResourceProducer(unix.getUser())))
                .build();
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.language.FileResource

            }

            // And finally as a fall-back let's look in the module's resource dir...
            final File target = new File(new File(car.getParentFile(), "module-resources"), fullPath);
            if (target.exists() && target.isFile() && target.canRead()) {
                return new FileResource(target);
            }
        }
       
        return null;
    }
View Full Code Here

Examples of com.sk89q.skmcl.install.FileResource

            if (path.exists()) {
                Extract extract = library.getExtract();
                if (extract != null) {
                    ZipExtract zipExtract = new ZipExtract(
                            new FileResource(path), extractDir);
                    zipExtract.setExclude(extract.getExclude());
                    zipExtract.run();
                } else {
                    builder.classPath(path);
                }
View Full Code Here

Examples of com.vaadin.server.FileResource

        Button b = new Button("Download " + filename);
        b.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                FileResource res = new FileResource(new File(VaadinService
                        .getCurrent().getBaseDirectory() + "/" + filename));
                getMainWindow().open(res);

            }
        });
View Full Code Here

Examples of com.vaadin.server.FileResource

            byte[] b = new byte[writeAtOnce];
            for (int i = 0; i < 5l * 1024l * 1024l; i += writeAtOnce) {
                os.write(b);
            }
            os.close();
            resource = new FileResource(hugeFile);
            addComponents("Huge text file", resource, components);
        } catch (IOException e) {
            e.printStackTrace();
        }
        // resource = new DynamicConnectorResource(this, "requestImage.png");
View Full Code Here

Examples of com.vaadin.terminal.FileResource

    emptySpace.setSizeUndefined();
    container.addComponent(emptySpace);
  }
 
  protected void exportModel() {
    final FileResource stream = new FileResource(new File(""), ExplorerApp.get()) {
     
      private static final long serialVersionUID = 1L;

        @Override
        public DownloadStream getStream() {
          DownloadStream ds = null;
          try {
           
            BpmnJsonConverter jsonConverter = new BpmnJsonConverter();
            JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
            BpmnModel bpmnModel = jsonConverter.convertToBpmnModel(editorNode);
            BpmnXMLConverter xmlConverter = new BpmnXMLConverter();
            byte[] bpmnBytes = xmlConverter.convertToXML(bpmnModel);
           
            ByteArrayInputStream in = new ByteArrayInputStream(bpmnBytes);
            String filename = bpmnModel.getMainProcess().getId() + ".bpmn20.xml";
            ds = new DownloadStream(in, "application/xml", filename);
            // Need a file download POPUP
            ds.setParameter("Content-Disposition", "attachment; filename=" + filename);
          } catch(Exception e) {
            LOGGER.log(Level.SEVERE, "failed to export model to BPMN XML", e);
            ExplorerApp.get().getNotificationManager().showErrorNotification(Messages.PROCESS_TOXML_FAILED, e);
          }
          return ds;
        }
    };
    stream.setCacheTime(0);
    ExplorerApp.get().getMainWindow().open(stream);
  }
View Full Code Here

Examples of cucumber.runtime.io.FileResource

        while (resources.hasNext()) {
            final Resource resource = resources.next();

            if (FileResource.class.isInstance(resource)) {
                final FileResource fr = FileResource.class.cast(resource);
                try {
                    final Field field = FileResource.class.getDeclaredField("file");
                    field.setAccessible(true);
                    list.add(File.class.cast(field.get(fr)).toURI().toURL());
                } catch (final Exception e) {
View Full Code Here

Examples of helma.framework.repository.FileResource

            for (int i = 0; i < skinNames.length; i++) {
                String name = skinNames[i].substring(0, skinNames[i].length() - 5);
                File file = new File(dir, skinNames[i]);

                Resource res = new FileResource(file);
                Resource prev = (Resource) super.put(name, res);
                res.setOverloadedResource(prev);
            }

        }
View Full Code Here

Examples of helma.framework.repository.FileResource

        }

        // create system properties
        sysProps = new ResourceProperties();
        if (config.hasPropFile()) {
            sysProps.addResource(new FileResource(config.getPropFile()));
        }
    }
View Full Code Here

Examples of helma.framework.repository.FileResource

        guessConfig(config);

        // create system properties
        ResourceProperties sysProps = new ResourceProperties();
        sysProps.addResource(new FileResource(config.getPropFile()));

        // check if there's a property setting for those ports not specified via command line
        if (!config.hasWebsrvPort() && sysProps.getProperty("webPort") != null) {
            try {
                config.setWebsrvPort(getInetSocketAddress(sysProps.getProperty("webPort")));
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.