protected FileParameterValue(String name, FileItem file, String originalFileName) { super(name); this.file = file; this.originalFileName = originalFileName; setLocation(name); }
public FileParameterValue createValue(StaplerRequest req, JSONObject jo) { FileParameterValue p = req.bindJSON(FileParameterValue.class, jo); p.setLocation(getName()); p.setDescription(getDescription()); return p; }
@SuppressWarnings("deprecation") @Override public ParameterValue createValue(CLICommand command, String value) throws IOException, InterruptedException { // capture the file to the server File local = File.createTempFile("jenkins","parameter"); String name; if (value.isEmpty()) { FileUtils.copyInputStreamToFile(command.stdin, local); name = "stdin"; } else { FilePath src = new FilePath(command.checkChannel(), value); src.copyTo(new FilePath(local)); name = src.getName(); } FileParameterValue p = new FileParameterValue(getName(), local, name); p.setDescription(getDescription()); p.setLocation(getName()); return p; } }
@Override public ParameterValue createValue(StaplerRequest req) { FileItem src; try { src = req.getFileItem( getName() ); } catch (ServletException | IOException e) { // Not sure what to do here. We might want to raise this // but that would involve changing the throws for this call return null; } if ( src == null ) { // the requested file parameter wasn't uploaded return null; } FileParameterValue p = new FileParameterValue(getName(), src, getFileName(src.getName())); p.setDescription(getDescription()); p.setLocation(getName()); return p; }
protected FileParameterValue(String name, FileItem file, String originalFileName) { super(name); this.file = file; this.originalFileName = originalFileName; setLocation(name); }
public FileParameterValue createValue(StaplerRequest req, JSONObject jo) { FileParameterValue p = req.bindJSON(FileParameterValue.class, jo); p.setLocation(getName()); p.setDescription(getDescription()); return p; }
public FileParameterValue createValue(StaplerRequest req, JSONObject jo) { FileParameterValue p = req.bindJSON(FileParameterValue.class, jo); p.setLocation(getName()); p.setDescription(getDescription()); return p; }
public FileParameterValue createValue(StaplerRequest req, JSONObject jo) { FileParameterValue p = req.bindJSON(FileParameterValue.class, jo); p.setLocation(getName()); p.setDescription(getDescription()); return p; }
public FileParameterValue createValue(StaplerRequest req, JSONObject jo) { FileParameterValue p = req.bindJSON(FileParameterValue.class, jo); p.setLocation(getName()); p.setDescription(getDescription()); return p; }
public FileParameterValue createValue(StaplerRequest req, JSONObject jo) { FileParameterValue p = req.bindJSON(FileParameterValue.class, jo); p.setLocation(getName()); p.setDescription(getDescription()); return p; }
@SuppressWarnings("deprecation") @Override public ParameterValue createValue(CLICommand command, String value) throws IOException, InterruptedException { // capture the file to the server File local = File.createTempFile("jenkins","parameter"); String name; if (value.isEmpty()) { FileUtils.copyInputStreamToFile(command.stdin, local); name = "stdin"; } else { FilePath src = new FilePath(command.checkChannel(), value); src.copyTo(new FilePath(local)); name = src.getName(); } FileParameterValue p = new FileParameterValue(getName(), local, name); p.setDescription(getDescription()); p.setLocation(getName()); return p; } }
@Override public ParameterValue createValue(CLICommand command, String value) throws IOException, InterruptedException { // capture the file to the server FilePath src = new FilePath(command.channel,value); File local = File.createTempFile("hudson","parameter"); src.copyTo(new FilePath(local)); FileParameterValue p = new FileParameterValue(getName(), local, src.getName()); p.setDescription(getDescription()); p.setLocation(getName()); return p; } }
@Override public ParameterValue createValue(CLICommand command, String value) throws IOException, InterruptedException { // capture the file to the server FilePath src = new FilePath(command.channel, value); File local = File.createTempFile("hudson", "parameter"); src.copyTo(new FilePath(local)); FileParameterValue p = new FileParameterValue(getName(), local, src.getName()); p.setDescription(getDescription()); p.setLocation(getName()); return p; } }
@Override public ParameterValue createValue(CLICommand command, String value) throws IOException, InterruptedException { // capture the file to the server FilePath src = new FilePath(command.channel,value); File local = File.createTempFile("hudson","parameter"); src.copyTo(new FilePath(local)); FileParameterValue p = new FileParameterValue(getName(), local, src.getName()); p.setDescription(getDescription()); p.setLocation(getName()); return p; } }
@Override public ParameterValue createValue(CLICommand command, String value) throws IOException, InterruptedException { // capture the file to the server FilePath src = new FilePath(command.channel,value); File local = File.createTempFile("hudson","parameter"); src.copyTo(new FilePath(local)); FileParameterValue p = new FileParameterValue(getName(), local, src.getName()); p.setDescription(getDescription()); p.setLocation(getName()); return p; } }
@Override public ParameterValue createValue(StaplerRequest req) { FileItem src; try { src = req.getFileItem( getName() ); } catch (ServletException | IOException e) { // Not sure what to do here. We might want to raise this // but that would involve changing the throws for this call return null; } if ( src == null ) { // the requested file parameter wasn't uploaded return null; } FileParameterValue p = new FileParameterValue(getName(), src, getFileName(src.getName())); p.setDescription(getDescription()); p.setLocation(getName()); return p; }