All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.jhipster.lite.module.domain.properties.JHipsterProjectFolder Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package tech.jhipster.lite.module.domain.properties;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import tech.jhipster.lite.shared.error.domain.Assert;

public record JHipsterProjectFolder(String folder) {
  public JHipsterProjectFolder {
    Assert.notBlank("folder", folder);
  }

  public Path filePath(String file) {
    Assert.notNull("file", file);

    return Paths.get(folder(), file);
  }

  public boolean fileExists(String fileName) {
    return Files.exists(filePath(fileName));
  }

  public String get() {
    return folder();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy