diff --git a/genai/pom.xml b/genai/pom.xml
new file mode 100644
index 00000000000..9df419b4d72
--- /dev/null
+++ b/genai/pom.xml
@@ -0,0 +1,76 @@
+
+
+
+ 4.0.0
+ jar
+ com.example.genai
+ genai-snippets
+ Google Cloud Gen AI Snippets
+ https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/vision
+
+
+
+ com.google.cloud.samples
+ shared-configuration
+ 1.2.0
+
+
+
+ 11
+ 11
+ UTF-8
+
+
+
+
+
+ com.google.cloud
+ libraries-bom
+ import
+ pom
+ 26.43.0
+
+
+
+
+
+
+ com.google.genai
+ google-genai
+ 0.5.0
+
+
+
+
+ junit
+ junit
+ 4.13.2
+ test
+
+
+ com.google.truth
+ truth
+ 1.4.0
+ test
+
+
+
\ No newline at end of file
diff --git a/genai/src/main/java/genai/GenerateContentWithRouting.java b/genai/src/main/java/genai/GenerateContentWithRouting.java
new file mode 100644
index 00000000000..49163a2ea23
--- /dev/null
+++ b/genai/src/main/java/genai/GenerateContentWithRouting.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package genai;
+
+// [START genai_generate_content_with_routing]
+import com.google.genai.Client;
+import com.google.genai.types.GenerateContentConfig;
+import com.google.genai.types.GenerateContentResponse;
+import com.google.genai.types.HttpOptions;
+import com.google.genai.types.ModelSelectionConfig;
+
+public class GenerateContentWithRouting {
+
+ public static void main(String[] args) throws Exception {
+
+ // TODO(developer): Replace these variables before running the sample.
+ String promptText = "Why do we have 365 days in a year?";
+ String featureSelectionPreference = "PRIORITIZE_COST";
+
+ String generateContentText = generateContent(promptText, featureSelectionPreference);
+
+ System.out.println("Response: " + generateContentText);
+ }
+
+ public static String generateContent(String promptText, String featureSelectionPreference) {
+
+ ModelSelectionConfig modelSelectionConfig =
+ ModelSelectionConfig.builder()
+ .featureSelectionPreference(featureSelectionPreference)
+ .build();
+
+ GenerateContentConfig generateContentConfig =
+ GenerateContentConfig.builder().modelSelectionConfig(modelSelectionConfig).build();
+
+ String modelName = "model-optimizer-exp-04-09";
+
+ HttpOptions httpOptions = HttpOptions.builder().apiVersion("v1beta1").build();
+
+ Client client = Client.builder().httpOptions(httpOptions).build();
+
+ GenerateContentResponse response =
+ client.models.generateContent(modelName, promptText, generateContentConfig);
+
+ return response.text();
+ }
+}
+ // [END genai_generate_content_with_routing]
diff --git a/genai/src/main/java/genai/StreamGenerateContentWithRouting.java b/genai/src/main/java/genai/StreamGenerateContentWithRouting.java
new file mode 100644
index 00000000000..774b97515f9
--- /dev/null
+++ b/genai/src/main/java/genai/StreamGenerateContentWithRouting.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package genai;
+
+// [START genai_stream_generate_content_with_routing]
+import com.google.genai.Client;
+import com.google.genai.ResponseStream;
+import com.google.genai.types.GenerateContentConfig;
+import com.google.genai.types.GenerateContentResponse;
+import com.google.genai.types.HttpOptions;
+import com.google.genai.types.ModelSelectionConfig;
+
+public class StreamGenerateContentWithRouting {
+
+ public static void main(String[] args) throws Exception {
+
+ // TODO(developer): Replace these variables before running the sample.
+ String promptText = "Why do we have 365 days in a year?";
+ String featureSelectionPreference = "BALANCED";
+
+ String generateContentStreamText =
+ generateContentStream(promptText, featureSelectionPreference);
+
+ System.out.println("Response: " + generateContentStreamText);
+ }
+
+ public static String generateContentStream(String promptText, String featureSelectionPreference) {
+
+ ModelSelectionConfig modelSelectionConfig =
+ ModelSelectionConfig.builder()
+ .featureSelectionPreference(featureSelectionPreference)
+ .build();
+
+ GenerateContentConfig generateContentConfig =
+ GenerateContentConfig.builder().modelSelectionConfig(modelSelectionConfig).build();
+
+ String modelName = "model-optimizer-exp-04-09";
+
+ HttpOptions httpOptions = HttpOptions.builder().apiVersion("v1beta1").build();
+
+ Client client = Client.builder().httpOptions(httpOptions).build();
+
+ ResponseStream responseStream =
+ client.models.generateContentStream(modelName, promptText, generateContentConfig);
+
+ String streamResponse = "";
+
+ for (GenerateContentResponse res : responseStream) {
+ streamResponse += res.text();
+ }
+
+ return streamResponse;
+ }
+}
+// [END genai_stream_generate_content_with_routing]
diff --git a/genai/src/test/java/genai/GenerateContentWithRoutingIT.java b/genai/src/test/java/genai/GenerateContentWithRoutingIT.java
new file mode 100644
index 00000000000..e35e0410aa5
--- /dev/null
+++ b/genai/src/test/java/genai/GenerateContentWithRoutingIT.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Tests for Gemini code samples.
+
+package genai;
+
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class GenerateContentWithRoutingIT {
+
+ // Check if the required environment variables are set.
+ public static void requireEnvVar(String envVarName) {
+ assertWithMessage(String.format("Missing environment variable '%s' ", envVarName))
+ .that(System.getenv(envVarName))
+ .isNotEmpty();
+ }
+
+ @BeforeClass
+ public static void setUp() throws IOException {
+ try (PrintStream out = System.out) {
+ ByteArrayOutputStream stdOut = new ByteArrayOutputStream();
+ System.setOut(new PrintStream(stdOut));
+
+ requireEnvVar("GOOGLE_GENAI_USE_VERTEXAI");
+ requireEnvVar("GOOGLE_CLOUD_PROJECT");
+ requireEnvVar("GOOGLE_CLOUD_LOCATION");
+
+ stdOut.close();
+ System.setOut(out);
+ }
+ }
+
+ @Test
+ public void testGenerateContentWithRouting() throws Exception {
+ String textPrompt =
+ "What's a good name for a flower shop that specializes in selling bouquets of"
+ + " dried flowers?";
+
+ String featureSelectionPreference = "PRIORITIZE_COST";
+
+ String output =
+ GenerateContentWithRouting.generateContent(textPrompt, featureSelectionPreference);
+ assertThat(output).isNotEmpty();
+ System.out.println(output);
+ }
+}
diff --git a/genai/src/test/java/genai/StreamGenerateContentWithRoutingIT.java b/genai/src/test/java/genai/StreamGenerateContentWithRoutingIT.java
new file mode 100644
index 00000000000..0d4015f7e33
--- /dev/null
+++ b/genai/src/test/java/genai/StreamGenerateContentWithRoutingIT.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Tests for Gemini code samples.
+
+package genai;
+
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class StreamGenerateContentWithRoutingIT {
+
+ // Check if the required environment variables are set.
+ public static void requireEnvVar(String envVarName) {
+ assertWithMessage(String.format("Missing environment variable '%s' ", envVarName))
+ .that(System.getenv(envVarName))
+ .isNotEmpty();
+ }
+
+ @BeforeClass
+ public static void setUp() throws IOException {
+ try (PrintStream out = System.out) {
+ ByteArrayOutputStream stdOut = new ByteArrayOutputStream();
+ System.setOut(new PrintStream(stdOut));
+
+ requireEnvVar("GOOGLE_GENAI_USE_VERTEXAI");
+ requireEnvVar("GOOGLE_CLOUD_PROJECT");
+ requireEnvVar("GOOGLE_CLOUD_LOCATION");
+
+ stdOut.close();
+ System.setOut(out);
+ }
+ }
+
+ @Test
+ public void testStreamGenerateContentWithRouting() throws Exception {
+ String textPrompt =
+ "What's a good name for a flower shop that specializes in selling bouquets of"
+ + " dried flowers?";
+
+ String featureSelectionPreference = "PRIORITIZE_QUALITY";
+
+ String output =
+ StreamGenerateContentWithRouting.generateContentStream(
+ textPrompt, featureSelectionPreference);
+ assertThat(output).isNotEmpty();
+ }
+}
diff --git a/storage-transfer/bin/pom.xml b/storage-transfer/bin/pom.xml
new file mode 100644
index 00000000000..20b9eb81489
--- /dev/null
+++ b/storage-transfer/bin/pom.xml
@@ -0,0 +1,147 @@
+
+
+
+
+ 4.0.0
+
+ com.example.storagetransfer
+ storage-transfer-sample
+ 0.1
+ jar
+
+
+ com.google.cloud.samples
+ shared-configuration
+ 1.2.0
+
+
+
+ 1.8
+ 1.8
+ UTF-8
+
+
+
+
+
+ libraries-bom
+ com.google.cloud
+ import
+ pom
+ 26.32.0
+
+
+
+
+
+
+ com.google.apis
+ google-api-services-storagetransfer
+ v1-rev20240126-2.0.0
+
+
+ com.google.guava
+ guava-jdk5
+
+
+
+
+ com.google.cloud
+ google-cloud-storage-transfer
+
+
+ com.google.auth
+ google-auth-library-oauth2-http
+
+
+ com.google.guava
+ guava
+
+
+
+
+ com.google.truth
+ truth
+ 1.4.0
+ test
+
+
+
+ junit
+ junit
+ 4.13.2
+ test
+
+
+
+ org.mockito
+ mockito-core
+ 5.10.0
+ test
+
+
+
+ com.google.cloud
+ google-cloud-storage
+ test
+
+
+
+ com.google.cloud
+ google-cloud-pubsub
+ test
+
+
+
+ com.amazonaws
+ aws-java-sdk-s3
+ 1.12.657
+ test
+
+
+
+ com.amazonaws
+ aws-java-sdk-sqs
+ 1.12.657
+ test
+
+
+
+ com.azure
+ azure-storage-blob
+ 12.25.1
+
+
+
+ slf4j-api
+ org.slf4j
+ 2.0.12
+
+
+
+ slf4j-simple
+ org.slf4j
+ 2.0.12
+
+
+
+