11///usr/bin/env jbang "$0" "$@" ; exit $?
22
33//DEPS info.picocli:picocli:4.6.3
4- //DEPS https://github.com/ gitlab4j/ gitlab4j-api/commit/5805b41bae64b6c287abdbd51f63ce84d1ec8b90
4+ //DEPS org. gitlab4j: gitlab4j-api:6.0.0-rc.7
55//JAVA 17
66
77import java .io .FileInputStream ;
@@ -70,18 +70,16 @@ public Integer call() throws Exception {
7070 filename = fileToUpload .getFileName ()
7171 .toString ();
7272 }
73- if (project == null && group == null ) {
73+ if (project == null && group == null ) {
7474 throw new IllegalStateException ("Project or group is mandatory" );
75- } else if (project != null && group != null ) {
75+ } else if (project != null && group != null ) {
7676 throw new IllegalStateException ("Project and group can't be set at the same time" );
77- } else if (project != null ) {
77+ } else if (project != null ) {
7878 FileUpload uplaodedFile = gitLabApi .getProjectApi ()
7979 .uploadFile (idOrPath (project ), Files .newInputStream (fileToUpload ), filename , null );
8080 System .out .println (uplaodedFile );
81- } else if (group != null ) {
82- FileUpload uplaodedFile = gitLabApi .getGroupApi ()
83- .uploadFile (idOrPath (group ), Files .newInputStream (fileToUpload ), filename , null );
84- System .out .println (uplaodedFile );
81+ } else if (group != null ) {
82+ throw new IllegalStateException ("Upload on goup is not available, see: https://gitlab.com/gitlab-org/gitlab/-/issues/329615" );
8583 }
8684 }
8785 return 0 ;
@@ -90,12 +88,11 @@ public Integer call() throws Exception {
9088 private GitLabApi createGitLabApi (String gitLabUrl , String gitLabAuthValue ) {
9189 if (logHttp != null && logHttp ) {
9290 return new GitLabApi (gitLabUrl , gitLabAuthValue )
93- .withRequestResponseLogging (java .util .logging .Level .INFO ) ;
91+ .withRequestResponseLogging (java .util .logging .Level .INFO );
9492 }
9593 return new GitLabApi (gitLabUrl , gitLabAuthValue );
9694 }
9795
98-
9996 private void filePathMandatory () {
10097 if (filePath == null ) {
10198 throw new IllegalStateException ("File is mandatory" );
0 commit comments