我在詹金斯有一份工作,有2个参数.我想运行另一个计划,该计划没有参数,并且根据该计划,根据需要多次启动现有计划.
新计划需要安排每15分钟运行一次(将由Jenkins的调度程序选项完成),该计划的代码将:
完成此操作后,我需要使用存储的每个键/值对运行现有作业.我可以像Jenkins一样开箱即用(使用1.406),还是必须远程调用现有作业?在使用"构建后操作"部分中的"构建其他项目"选项(计划的配置)时,我看不到如何将参数从一个计划传递到另一个计划
谢谢
我有一些命令在磁盘上创建一个文件.因为必须在其中创建文件的文件夹是动态的,所以我有一个catch(FileNotFoundException e).在同一个try块中,我已经有了一个catch(Exception e)块.出于某种原因,当我运行我的代码并且该文件夹尚不存在时,使用了catch(Exception e)块,而不是FileNotFoundException块.
调试器很清楚(至少对我来说),显示一个FileNotFoundException:java.io.FileNotFoundException:c:\ mydata\2F8890C2-13B9-4D65-987D-5F447FF0DDA7\filename.png(系统找不到指定的路径)
知道它为什么不进入FileNotFoundException块吗?谢谢;
码:
import java.io.FileNotFoundException;
try{
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle screenRectangle = new Rectangle(screenSize);
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(screenRectangle);
ImageIO.write(image, "png", new File(fileName));
}
catch (FileNotFoundException e){
// do stuff here..
return false;
}
catch(Exception e){
// do stuff here..
return = false;
}
Run Code Online (Sandbox Code Playgroud) 将毫秒格式化为SimpleDate格式时,我遇到了一个奇怪的结果:
输出是:
Start date time: 11/06/30 09:45:48:970
End date time: 11/06/30 09:45:52:831
Execution time: 01:00:03:861
Run Code Online (Sandbox Code Playgroud)
脚本:
long dateTimeStart = System.currentTimeMillis();
// some script execution here
long dateTimeEnd = System.currentTimeMillis();
"Start date time: " + GlobalUtilities.getDate(dateTimeStart, "yy/MM/dd hh:mm:ss:SSS");
"End date time: " + GlobalUtilities.getDate(dateTimeEnd, "yy/MM/dd hh:mm:ss:SSS");
"Execution time: " + GlobalUtilities.getDate((dateTimeEnd - dateTimeStart), "hh:mm:ss:SSS");
Run Code Online (Sandbox Code Playgroud)
方法:
public static String getDate(long milliseconds, String format)
{
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(milliseconds);
}
Run Code Online (Sandbox Code Playgroud)
知道为什么执行时间值如此偏离?它应该是00:00:03:861,而不是01:00:03:861
谢谢
我正在尝试从一台服务器创建一个文件到另一台服务器.服务器A执行需要在一台服务器B上创建文件的脚本.服务器A有一个脚本可以创建没有问题的文件夹(没有权限被拒绝或任何内容),并在创建文件夹后调用以下代码:
byte[] btDataFile = new sun.misc.BASE64Decoder().decodeBuffer(base64);
File of = new File("driverLetter:\folder_path\filename.png");
FileOutputStream osf = new FileOutputStream(of);
osf.write(btDataFile);
osf.flush();
Run Code Online (Sandbox Code Playgroud)
"base64"是png图像的base64字符串表示,我需要将其作为文件创建.字符串的值很长,所以我不能在这里发布,但它在那里,不是空的,不是null,它有一个值.但代码抛出错误:
"Can't read input file!"
Run Code Online (Sandbox Code Playgroud)
为什么脚本会读取"输入文件"?谢谢