Skip to content
Open
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
14 changes: 14 additions & 0 deletions PublicData/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>PublicData</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
<exec.mainClass>com.mycompany.publicdata.PublicData</exec.mainClass>
</properties>
</project>
34 changes: 34 additions & 0 deletions PublicData/src/main/java/com/mycompany/publicdata/PublicData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
*/

package com.mycompany.publicdata;

/**
* This is the main class for the PublicData project.
*
* Features:
* - Basic input validation method.
* - Prints a greeting message.
*
* Author: hoang
*/
public class PublicData {

public static void main(String[] args) {
System.out.println("Hello World!");

// Example usage of the isValidData method
String data = "Sample data";
if (isValidData(data)) {
System.out.println("The data is valid.");
} else {
System.out.println("Invalid data.");
}
}


public static boolean isValidData(String data) {
return data != null && !data.trim().isEmpty();
}
}