jdk/src/java.base/share/classes/java/lang/ProcessHandle.java
changeset 32209 24bb680a1609
parent 31681 e9a9d5b369bc
child 32764 1586fc6697da
equal deleted inserted replaced
32167:c8753d0be177 32209:24bb680a1609
   223          *         of the process
   223          *         of the process
   224          */
   224          */
   225         public Optional<String> command();
   225         public Optional<String> command();
   226 
   226 
   227         /**
   227         /**
       
   228          * Returns the command line of the process.
       
   229          * <p>
       
   230          * If {@link #command command()} and  {@link #arguments arguments()} return
       
   231          * non-empty optionals, this is simply a convenience method which concatenates
       
   232          * the values of the two functions separated by spaces. Otherwise it will return a
       
   233          * best-effort, platform dependent representation of the command line.
       
   234          *
       
   235          * @apiNote Note that the returned executable pathname and the
       
   236          *          arguments may be truncated on some platforms due to system
       
   237          *          limitations.
       
   238          *          <p>
       
   239          *          The executable pathname may contain only the
       
   240          *          name of the executable without the full path information.
       
   241          *          It is undecideable whether white space separates different
       
   242          *          arguments or is part of a single argument.
       
   243          *
       
   244          * @return an {@code Optional<String>} of the command line
       
   245          *         of the process
       
   246          */
       
   247         public Optional<String> commandLine();
       
   248 
       
   249         /**
   228          * Returns an array of Strings of the arguments of the process.
   250          * Returns an array of Strings of the arguments of the process.
       
   251          *
       
   252          * @apiNote On some platforms, native applications are free to change
       
   253          *          the arguments array after startup and this method may only
       
   254          *          show the changed values.
   229          *
   255          *
   230          * @return an {@code Optional<String[]>} of the arguments of the process
   256          * @return an {@code Optional<String[]>} of the arguments of the process
   231          */
   257          */
   232         public Optional<String[]> arguments();
   258         public Optional<String[]> arguments();
   233 
   259