NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed. (sponsored)
In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.
Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.
Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Mustang is the codename for the next release of Java (Java 6, Java SE 6, JSE 6, whatever you
want to call it), and is currently in early adoption (
Mustang.dev.java.net
).
This effectively means that while it isn't released, you can start to play with the
details in Mustang, and, within care and reason, start to consider them for your
product that may be based on Java SE 6. I would recommend downloading a snapshot
of Mustang, and trying your favorite Java applications on it, just to get a feel
for what is coming. As most of you probably know, I am a glutton for punishment, and I'm
never satisfied with the current state of affairs. So, instead, I have to download
unfinished code, and extol the virtues of that which we as-of-yet don't have. Mustang
is a veritable goldmine of unfinished 'latest-and-greatest' features. Now, this
sounds silly, childish, and at least somewhat related to a mental disorder - but you
know you all do it from time to time - and you know want to keep reading, and join
me on this path of self indulgence.
One feature that developers have asked
for again and again over the course of more than
8 years
(697 votes is quite a few), yet Java has never
had, is a facility for determining disk/partition size and availability. Up until
now, there has been no way to determine the free/used space on a partition using
Java. Mustang, however, now has preliminary support built in.
Here is a sample of how to use these methods (on Windows):
File f = new File("c:/");
// prints the volume size in bytes.
System.out.println(f.getTotalSpace());
// prints the total free bytes for the volume in bytes.
System.out.println(f.getFreeSpace());
// prints an accurate estimate of the total free (and available) bytes
// on the volume. This method may return the same result as 'getFreeSpace()' on
// some platforms.
System.out.println(f.getUsableSpace());
From what I have seen, you should take care that the file object these methods are called
on represents a partition or volume - otherwise the value returned could be 0. Also,
be aware that these methods (although not very likely) have the potential to change -
Mustang is not finished yet, and until it is, any new API is fair game to be changed,
swapped, altered, poked, prodded, and set on fire. You have been warned - now go
have fun with it.
Re: Mustang: Find Disk Space With New File Methods
what i am really wondering is, what was the thing people are underestimating on this fix? obviously there was something challenging made this that late. disk quotas? OS did not have the utility? Anybody knows the internals of this?
Re: Mustang: Find Disk Space With New File Methods
That's a very good question; had me wondering too. From the bug report:
Resolution of this request is considered a high priority for Mustang.
Active development on this feature has been in progress for the past
several months. I expect that we will complete this work within the
next couple of months. These methods will be in Mustang-beta.
That sounds a lot like it took several months to develop the implementation. Maybe some of the less common platforms were harder to provide support for.... I don't know.
Mustang: Find Disk Space With New File Methods
At 11:12 PM on Jul 12, 2005, R.J. Lorimer wrote:
Fresh Jobs for Developers Post a job opportunity
Mustang is the codename for the next release of Java (Java 6, Java SE 6, JSE 6, whatever you want to call it), and is currently in early adoption ( Mustang.dev.java.net ). This effectively means that while it isn't released, you can start to play with the details in Mustang, and, within care and reason, start to consider them for your product that may be based on Java SE 6. I would recommend downloading a snapshot of Mustang, and trying your favorite Java applications on it, just to get a feel for what is coming. As most of you probably know, I am a glutton for punishment, and I'm never satisfied with the current state of affairs. So, instead, I have to download unfinished code, and extol the virtues of that which we as-of-yet don't have. Mustang is a veritable goldmine of unfinished 'latest-and-greatest' features. Now, this sounds silly, childish, and at least somewhat related to a mental disorder - but you know you all do it from time to time - and you know want to keep reading, and join me on this path of self indulgence.
One feature that developers have asked for again and again over the course of more than 8 years (697 votes is quite a few), yet Java has never had, is a facility for determining disk/partition size and availability. Up until now, there has been no way to determine the free/used space on a partition using Java. Mustang, however, now has preliminary support built in.
Here is a sample of how to use these methods (on Windows):
File f = new File("c:/"); // prints the volume size in bytes. System.out.println(f.getTotalSpace()); // prints the total free bytes for the volume in bytes. System.out.println(f.getFreeSpace()); // prints an accurate estimate of the total free (and available) bytes // on the volume. This method may return the same result as 'getFreeSpace()' on // some platforms. System.out.println(f.getUsableSpace());From what I have seen, you should take care that the file object these methods are called on represents a partition or volume - otherwise the value returned could be 0. Also, be aware that these methods (although not very likely) have the potential to change - Mustang is not finished yet, and until it is, any new API is fair game to be changed, swapped, altered, poked, prodded, and set on fire. You have been warned - now go have fun with it.
Until next time,
R.J. Lorimer
Contributing Editor -rj -at- javalobby.orgAuthor -http://www.coffee-bytes.comSoftware Consultant -http://www.crosslogic.com6 replies so far (
Post your own)
Re: Mustang: Find Disk Space With New File Methods
I've had that capability in JConfig since the last century. Good to know Pure Java is finally catching up.Re: Mustang: Find Disk Space With New File Methods
I had never seen this piece of software before. Thank you for posting it. Looks interesting.Re: Mustang: Find Disk Space With New File Methods
what i am really wondering is, what was the thing people are underestimating on this fix? obviously there was something challenging made this that late. disk quotas? OS did not have the utility? Anybody knows the internals of this?Re: Mustang: Find Disk Space With New File Methods
That's a very good question; had me wondering too. From the bug report:Resolution of this request is considered a high priority for Mustang.
Active development on this feature has been in progress for the past
several months. I expect that we will complete this work within the
next couple of months. These methods will be in Mustang-beta.
That sounds a lot like it took several months to develop the implementation. Maybe some of the less common platforms were harder to provide support for.... I don't know.
Re: Mustang: Find Disk Space With New File Methods
HiThis is the great feature actually.Can you suggest me any API is available in java1.6 to find out the CPU Utilization and Memory Usage too.
Thanks in Advance.
Regards
Ravi Kumar Vanama
Re: Mustang: Find Disk Space With New File Methods
Cool, master a tip today.