hudson.Launcher.printCommandLine()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中hudson.Launcher.printCommandLine()方法的一些代码示例,展示了Launcher.printCommandLine()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Launcher.printCommandLine()方法的具体详情如下:
包路径:hudson.Launcher
类名称:Launcher
方法名:printCommandLine

Launcher.printCommandLine介绍

[英]Prints out the command line to the listener so that users know what we are doing.
[中]将命令行打印到侦听器,以便用户知道我们在做什么。

代码示例

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Prints out the command line to the listener with some portions masked to prevent sensitive information from being
  3. * recorded on the listener.
  4. *
  5. * @param cmd The commands
  6. * @param mask An array of booleans which control whether a cmd element should be masked (<code>true</code>) or
  7. * remain unmasked (<code>false</code>).
  8. * @param workDir The work dir.
  9. */
  10. protected final void maskedPrintCommandLine(@Nonnull List<String> cmd, @CheckForNull boolean[] mask, @CheckForNull FilePath workDir) {
  11. if(mask==null) {
  12. printCommandLine(cmd.toArray(new String[cmd.size()]),workDir);
  13. return;
  14. }
  15. assert mask.length == cmd.size();
  16. final String[] masked = new String[cmd.size()];
  17. for (int i = 0; i < cmd.size(); i++) {
  18. if (mask[i]) {
  19. masked[i] = "********";
  20. } else {
  21. masked[i] = cmd.get(i);
  22. }
  23. }
  24. printCommandLine(masked, workDir);
  25. }

代码示例来源:origin: org.eclipse.hudson/hudson-core

  1. /**
  2. * Prints out the command line to the listener with some portions masked to
  3. * prevent sensitive information from being recorded on the listener.
  4. *
  5. * @param cmd The commands
  6. * @param mask An array of booleans which control whether a cmd element
  7. * should be masked (<code>true</code>) or remain unmasked
  8. * (<code>false</code>).
  9. * @param workDir The work dir.
  10. */
  11. protected final void maskedPrintCommandLine(List<String> cmd, boolean[] mask, FilePath workDir) {
  12. if (mask == null) {
  13. printCommandLine(cmd.toArray(new String[cmd.size()]), workDir);
  14. return;
  15. }
  16. assert mask.length == cmd.size();
  17. final String[] masked = new String[cmd.size()];
  18. for (int i = 0; i < cmd.size(); i++) {
  19. if (mask[i]) {
  20. masked[i] = "********";
  21. } else {
  22. masked[i] = cmd.get(i);
  23. }
  24. }
  25. printCommandLine(masked, workDir);
  26. }

代码示例来源:origin: hudson/hudson-2.x

  1. /**
  2. * Prints out the command line to the listener with some portions masked to prevent sensitive information from being
  3. * recorded on the listener.
  4. *
  5. * @param cmd The commands
  6. * @param mask An array of booleans which control whether a cmd element should be masked (<code>true</code>) or
  7. * remain unmasked (<code>false</code>).
  8. * @param workDir The work dir.
  9. */
  10. protected final void maskedPrintCommandLine(List<String> cmd, boolean[] mask, FilePath workDir) {
  11. if(mask==null) {
  12. printCommandLine(cmd.toArray(new String[cmd.size()]),workDir);
  13. return;
  14. }
  15. assert mask.length == cmd.size();
  16. final String[] masked = new String[cmd.size()];
  17. for (int i = 0; i < cmd.size(); i++) {
  18. if (mask[i]) {
  19. masked[i] = "********";
  20. } else {
  21. masked[i] = cmd.get(i);
  22. }
  23. }
  24. printCommandLine(masked, workDir);
  25. }
  26. protected final void maskedPrintCommandLine(String[] cmd, boolean[] mask, FilePath workDir) {

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. /**
  2. * Prints out the command line to the listener with some portions masked to prevent sensitive information from being
  3. * recorded on the listener.
  4. *
  5. * @param cmd The commands
  6. * @param mask An array of booleans which control whether a cmd element should be masked (<code>true</code>) or
  7. * remain unmasked (<code>false</code>).
  8. * @param workDir The work dir.
  9. */
  10. protected final void maskedPrintCommandLine(@Nonnull List<String> cmd, @CheckForNull boolean[] mask, @CheckForNull FilePath workDir) {
  11. if(mask==null) {
  12. printCommandLine(cmd.toArray(new String[cmd.size()]),workDir);
  13. return;
  14. }
  15. assert mask.length == cmd.size();
  16. final String[] masked = new String[cmd.size()];
  17. for (int i = 0; i < cmd.size(); i++) {
  18. if (mask[i]) {
  19. masked[i] = "********";
  20. } else {
  21. masked[i] = cmd.get(i);
  22. }
  23. }
  24. printCommandLine(masked, workDir);
  25. }

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

  1. /**
  2. * Prints out the command line to the listener with some portions masked to prevent sensitive information from being
  3. * recorded on the listener.
  4. *
  5. * @param cmd The commands
  6. * @param mask An array of booleans which control whether a cmd element should be masked (<code>true</code>) or
  7. * remain unmasked (<code>false</code>).
  8. * @param workDir The work dir.
  9. */
  10. protected final void maskedPrintCommandLine(List<String> cmd, boolean[] mask, FilePath workDir) {
  11. if(mask==null) {
  12. printCommandLine(cmd.toArray(new String[cmd.size()]),workDir);
  13. return;
  14. }
  15. assert mask.length == cmd.size();
  16. final String[] masked = new String[cmd.size()];
  17. for (int i = 0; i < cmd.size(); i++) {
  18. if (mask[i]) {
  19. masked[i] = "********";
  20. } else {
  21. masked[i] = cmd.get(i);
  22. }
  23. }
  24. printCommandLine(masked, workDir);
  25. }
  26. protected final void maskedPrintCommandLine(String[] cmd, boolean[] mask, FilePath workDir) {

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

  1. /**
  2. * Prints out the command line to the listener with some portions masked to prevent sensitive information from being
  3. * recorded on the listener.
  4. *
  5. * @param cmd The commands
  6. * @param mask An array of booleans which control whether a cmd element should be masked (<code>true</code>) or
  7. * remain unmasked (<code>false</code>).
  8. * @param workDir The work dir.
  9. */
  10. protected final void maskedPrintCommandLine(List<String> cmd, boolean[] mask, FilePath workDir) {
  11. if(mask==null) {
  12. printCommandLine(cmd.toArray(new String[cmd.size()]),workDir);
  13. return;
  14. }
  15. assert mask.length == cmd.size();
  16. final String[] masked = new String[cmd.size()];
  17. for (int i = 0; i < cmd.size(); i++) {
  18. if (mask[i]) {
  19. masked[i] = "********";
  20. } else {
  21. masked[i] = cmd.get(i);
  22. }
  23. }
  24. printCommandLine(masked, workDir);
  25. }
  26. protected final void maskedPrintCommandLine(String[] cmd, boolean[] mask, FilePath workDir) {

相关文章