Skip to content

Commit

Permalink
fix checkstyle warining
Browse files Browse the repository at this point in the history
  • Loading branch information
sajid riaz committed Jan 8, 2024
1 parent c41dedf commit e35b43b
Showing 1 changed file with 38 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,34 +1,58 @@
/*
* Copyright 2024 Telefonaktiebolaget LM Ericsson
*
* 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 com.ericsson.bss.cassandra.ecchronos.application;

import java.io.*;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Paths;

public class EccYamlToMarkdownConverter
public final class EccYamlToMarkdownConverter
{
public static void main(String[] args)
{
String relativePathToDocs = "docs/autogenerated";
String markdownFileName = "EccYamlFile.md";
String yamlFilePath = "/ecc.yml"; // Resource path in the classpath

String currentWorkingDir = System.getProperty("user.dir");
String markdownFilePath = Paths.get(currentWorkingDir, relativePathToDocs, markdownFileName).toString();
private EccYamlToMarkdownConverter()
{
}

public static void main(final String[] args)
{
try
{
convertYamlToMarkdown(yamlFilePath, markdownFilePath);
convertYamlToMarkdown();
}
catch (IOException e)
{
e.printStackTrace();
}
}

private static void convertYamlToMarkdown(String yamlFilePath, String markdownFilePath) throws IOException
private static void convertYamlToMarkdown() throws IOException
{
final String relativePathToDocs = "docs/autogenerated";
final String markdownFileName = "EccYamlFile.md";
final String yamlFilePath = "/ecc.yml"; // Resource path in the classpath

final String currentWorkingDir = System.getProperty("user.dir");
String markdownFilePath = Paths.get(currentWorkingDir, relativePathToDocs, markdownFileName).toString();
try (InputStream inputStream = EccYamlToMarkdownConverter.class.getResourceAsStream(yamlFilePath);
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
BufferedWriter writer = new BufferedWriter(new FileWriter(markdownFilePath)))
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
BufferedWriter writer = new BufferedWriter(new FileWriter(markdownFilePath)))
{

if (inputStream == null)
Expand All @@ -53,7 +77,7 @@ private static void convertYamlToMarkdown(String yamlFilePath, String markdownFi
}
}

private static String convertLineToMarkdown(String line)
private static String convertLineToMarkdown(final String line)
{
String trimmedLine = line.trim();

Expand Down

0 comments on commit e35b43b

Please sign in to comment.