Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7731693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:32:48+00:00 2026-06-01T06:32:48+00:00

I have an HTML help system that I need to convert to SharePoint. The

  • 0

I have an HTML help system that I need to convert to SharePoint. The two most time consuming projects are to change the document links and to gather metadata. However, I’m lucky because this data is easily accessible. Each file is an HTML document, oversimplified as below:

 <body>
   <!--- Metadata follows
   Procedure Name: my document
   Procedure Number: xxxxx
   Use: freeform text explaining when procdure is used
   Revision Date: xx/xx/xx
   By: responsible party for revision
   <!--- end metadata

   <h1>Procedure Name<\h1>
   <p>procedure background and narrative, with links, as needed, to other documents at \\documentation-server\path\document-name.html
 <\body>

I can successfully extract & manipulate the right Strings, and I’m trying to incorporate that process into an automated solution. Since this is my first venture into file i/o, however, I’m a little fuzzy on what to do next.

In a perfect world, given a path, I would like to step though each *.html file in a path. I cannot seem to find a class/method to do that. newInputStream and newOutpuStream give me the file access, but I need to provide a path & file parameter. The FileVisitor interface appears to only interact file attributes and perform delete/copy/rename type functions.

Is there a soemthing that would combine these into a single function that would step through each file in a path, open it and allow my line-by-line parse, then close the file and move to the next one to repeat?

My other thought was to create an array of filenames, then feed that array into the filename parameter of newInputStream.

Suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:32:49+00:00Added an answer on June 1, 2026 at 6:32 am

    If you use Java 7, the FileVisitor interface enables you to walk a file tree very easily. See for example the Java Tutorial.

    You can override the visitFile method to do what you want with the file, for example (not tested):

    @Override
    public FileVisitResult visitFile(Path file, BasicFileAttributes attr) {
        if (attr.isRegularFile() && file.getFileName().toString().endsWith(".html")) {
            Charset charset = Charset.forName("UTF-16");
            try (BufferedReader reader = Files.newBufferedReader(file, charset)) {
               String line;
               while ((line = reader.readLine()) != null) {
                   System.out.println(line); //do what you need to do here
                }
             } catch (IOException x) {
                 //Print / log the errror
             }
        }
        return CONTINUE;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iframe-based online help system that has worked well for years. With
I have been using Sandcastle Help File Builder to produce help files (HTML 1.0)
can anyone help? I have a simple html file which i am filling via
I have HTML page with some HTML element with ID=logo . I need to
I need to open a html help file from within a legacy windows application
I have a java program that generates an HTML file. The Java program takes
I have an application that used another php cms system, which I am now
I need a system to log certain e-mail messages so that they can be
I am developing a WordPress page that uses a jquery.slideto.js navigation system and html
Imagine you have two adjacent columns. The first (left most) is the primary navigation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.