HTML Disturbed Link Patcher HTML Disturbed Link Patcher
home Student Projects no local find frame, full screen Google search web for topic jump to footer translate with Babelfish by Roedy Green ©1996-2008 Canadian Mind Products
This essay is about a suggested student project in Java programming. This essay gives a rough overview of how it might work. It does not describe an actual complete program. I have no source, object, specifications, file layouts or anything else useful to implementing this project. Everything I have to say to help you with this project is written below. I am not prepared to help you implement it; I have too many other projects of my own.

I do contract work for a living, which could include writing a program such as this. However, I don’t do people’s homework for them. That just robs them of an education.

You have my full permission to implement this project any way you please.

This project is vaguely related to the HTML broken link finder. This project does not just find broken links, it prevents them from being created in the process of reorganising your website. Every once in a while you want to reorganise your website, usually creating more subdirectories and separating files that were formerly together into different directories. With drag and drop, moving the files about is child’s play. The bullwork comes later fixing all the HREF links to those files to reflect the new directory locations.

I want to automate that process.

Here is how it works. You tell the program the root directory of your website on hard disk. It takes a snapshot of all the file names and where in the directory tree they appeared. You then use whatever tools you want to create new directories, move files around, delete files, add files etc. Then you ask the program to take a second snapshot. It then does its best to guess the old and new name of each file. It creates a file giving old and new name for you to review. If there are any errors (which could only happen if you don’t use unique filenames), you manually correct the old:new list.

Then you turn the utility loose patching all the HREFs. It is not quite as simple as a Funduc Search and Replace. You probably want to generate minimal relative links, e.g. you don’t specify the filename for a link to another place in the same file. You don’t specify the path if source and target are in the same directory. You use ../ if the target is in the mother directory of the source, etc.

You might even post your old:new list so people who have extensive references into your website can automatically update all their links too. This features give this project some great commercial potential. To apply link fixes, other websites will need your utility. It will then occur to them to post their fixes in that format too, in a chain reaction taking over the web. Eventually this may evolve into a global system of instantly updating global links.

To allow for the possibility that you split a file, not just moved it, the old:new list could also contain individual NAME tags so you can track their new locations. This project should integrate with the HTML File Splitter Project.

Microsoft tackled a problem similar to this, creating a distributing a continuously updated table of contents for MSDN. They offer their source code based on XML.

HTML broken link finder
Xenu

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.16] The information on this page is for non-military use only.
You are visitor number 3,366. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/project/htmllinkpatcher.html J:\mindprod\project\htmllinkpatcher.html