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

io.codemodder.DefaultEncodingDetector Maven / Gradle / Ivy

There is a newer version: 0.97.9
Show newest version
package io.codemodder;

import java.io.IOException;
import java.nio.file.Path;
import java.util.Optional;
import org.mozilla.universalchardet.UniversalDetector;

final class DefaultEncodingDetector implements EncodingDetector {
  @Override
  public Optional detect(final Path originalJavaFile) throws IOException {
    String encoding = UniversalDetector.detectCharset(originalJavaFile);
    return Optional.ofNullable(encoding);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy