Using Java to Control System Functions

Using Java to Control System Functions

Question:
I would like to be able to browse my server and havean applet/program that would mimic the functions of,say, the control panel on a Macintosh.Would I needto write a custom browser to be able to do this?

Also,I would like to be able to have the server check theversion of the browser and suggest to the user, “Doyou want to update your browser?” If they click”Yes,” have the new browser download and install.

Answer:
Java is probably not the right tool for doing this.

Creatinga control panel like that on the Macintosh requires that yourprogram have intimate knowledge of the operating system andhardware it is running on. Things like the audio volume level,number of colors on the screen, screen saver settings, speed ofthe CPU, battery saving features, and so on, are so tied to theoperating system and the vendor of the hardware, that Java cannotpossibly provide enough hooks for you to be able to accomplishthem all in Java.

Indeed, Java is meant to be used as a cross-platform language thatprovides a uniform, easy to access programming interface to themultitude of environments in use today. The point is thatapplications can be written once and run everywhere equally well.Putting in platform-specific dependencies takes away much of theadvantages of programming in Java in the first place.Moreover, Java applets are restricted even further in what they cando. This feature is what makes Java a secure programming languagefor the Web. An applet would never be allowed to read or configurea system’s settings, for example, because these could be exploitedby malicious applets.

The only system settings an applet would be able to read are thoseaccessible via the System.getProperties() call. This methodtakes astring parameter describing the property in question.Properties are divided into two categories: hidden and non-hiddenones. Hidden ones cannot be read by applets by default.

The list is as follows:

Non-hidden Properties  Description——————————————————-java.version           Java version numberjava.vendor            Java-vendor-specific stringjava.vendor.url        Java vendor URLjava.class.path        Java classpathos.name                Operating system nameos.arch                Operating system architectureos.version             Operating system versionfile.separator                 File separator (“/” on Unix)path.separator                 Path separator (“:” on Unix)line.separator                 Line separator (”
” on Unix)Hidden Properties Description——————————————————-user.name User account nameuser.home User home directoryuser.dir User’s current working directoryjava.home Java installation directoryjava.class.version Java class format version number
As you can see, this list is much too limited to allow youto do sophisticated things, but one thing you’ll notice isthat an applet can get the version of the operating systemand the browser if that information is carried in thejava.vendor property. The applet can then notify theuser that his/her browser is out of date and suggest thathe/she download a newer version.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing