Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
unit-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Java 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: temurin
cache: maven

- name: Build and unit test
run: mvn --batch-mode test
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
environment: MVN

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'

- name: Extract and validate version from tag
id: version
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Error: '$VERSION' is not valid semver (expected X.Y.Z)"
exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Set version in pom.xml
run: mvn versions:set -DnewVersion=${{ steps.version.outputs.version }} -DgenerateBackupPoms=false

- name: Build release JAR
run: mvn package -DskipTests

- name: Upload JAR to release
run: |
gh release upload "${{ github.event.release.tag_name }}" \
"target/ndex-java-client-${{ steps.version.outputs.version }}.jar" \
--clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy to Maven repository
run: mvn deploy -DskipTests --settings .mvn/settings.xml
env:
REPO_USER: ${{ secrets.REPO_USER }}
REPO_PWD: ${{ secrets.REPO_PWD }}
14 changes: 14 additions & 0 deletions .mvn/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<settings>
<servers>
<server>
<id>cytoscape_releases</id>
<username>${env.REPO_USER}</username>
<password>${env.REPO_PWD}</password>
</server>
<server>
<id>cytoscape_snapshots</id>
<username>${env.REPO_USER}</username>
<password>${env.REPO_PWD}</password>
</server>
</servers>
</settings>
142 changes: 0 additions & 142 deletions .travis.settings.xml

This file was deleted.

21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.1] - 2026-09-03

### Added

- **NDEx v3 folder support** — `getMyFolders(int limit)` lists the signed-in user's folders via `GET /v3/files/folders`, and `moveNetworks(MoveNetworksRequest)` moves networks into a folder via `POST /v3/batch/networks/move`.
- **NDEx v3 file search** — `searchFiles(SimpleFileQuery, FileVisibilityType, int start, int size)` queries `POST /v3/search/files`, supporting an optional `PUBLIC`/`PRIVATE` visibility filter and paging, and returning a `FileSearchResult`.
- **Visibility and folder on CX2 network create** — `createCX2Network(InputStream, VisibilityType, UUID folderId)` adds the `visibility` and `folderId` query parameters to `POST /v3/networks`, so a network can be created directly into a folder with its visibility set. A null value omits its parameter.
- **Visibility on CX2 network update** — `updateCX2Network(UUID, InputStream, VisibilityType)` adds the `visibility` query parameter to `PUT /v3/networks/{networkid}`. A null value omits it.

The pre-existing single-argument `createCX2Network(InputStream)` and `updateCX2Network(UUID, InputStream)` now delegate to the new overloads with null arguments and produce exactly the same unqueried routes as before, so existing callers are unaffected.

### Removed

- **Travis CI configuration** — deleted `.travis.yml` and `.travis.settings.xml` and dropped the Travis build-status badge from `README.md`. Replaced by GitHub Actions `ci.yml` and `release.yml` workflows, the latter deploying to the NRNB Nexus repository on a published GitHub release.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,10 @@ coverage: ## check code coverage with jacoco
install: clean ## install the package to local repo
mvn install

deploy: ## deploy to nrnb nexus, requires VERSION=x.y.z[-SNAPSHOT]
@test -n "$(VERSION)" || (echo "VERSION is required, e.g. make deploy VERSION=3.0.1-SNAPSHOT" && exit 1)
mvn versions:set -DnewVersion=$(VERSION) -DgenerateBackupPoms=false
mvn deploy

updateversion: ## updates version in pom.xml via maven command
mvn versions:set
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# ndex-java-client

[![Build Status](https://app.travis-ci.com/ndexbio/ndex-java-client.svg?branch=master)](https://app.travis-ci.com/ndexbio/ndex-java-client)

Java client library for accessing NDEx REST server
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.ndexbio.client</groupId>
<artifactId>ndex-java-client</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>
<name>NDEx Java REST Client</name>
<description>REST Client for in applications that access NDEx</description>
<inceptionYear>2013</inceptionYear>
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/org/ndexbio/rest/client/NdexRestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,27 @@ private HttpURLConnection putReturningConnection(final String route,
*/


/**
* POSTs a JSON body to a route that returns no content of interest, validating the
* response status the same way {@link #putNdexObject(String, JsonNode)} does.
*/
protected void postNdexObjectNoContent(
final String route,
final JsonNode postData)
throws IllegalStateException, Exception {
HttpURLConnection con = null;
try {
con = postReturningConnection(route, postData);
if ( con.getResponseCode() != HttpURLConnection.HTTP_NO_CONTENT &&
con.getResponseCode() != HttpURLConnection.HTTP_OK &&
con.getResponseCode() != HttpURLConnection.HTTP_CREATED) {
processNdexSpecificException(con.getErrorStream(), con.getResponseCode(), new ObjectMapper());
}
} finally {
if ( con != null) con.disconnect();
}
}

protected <T> T postNdexObject(
final String route,
final JsonNode postData,
Expand Down
Loading
Loading