Hai friends

How can i catch "There is not enough space on the disk" in IO Exception,
i want to show popup when there is low disk space in my system,its throwing following exception.
java.io.IOException: There is not enough space on the disk

i want to catch only diskspace.

please help me in this problem.

By simply catching IOException and using the getMessage method on the exception and the contains method on that String. You can not catch only that exception, though. If you want to make sure that the rest of the method will still continue if the exception is anything but that, then wrap just the statement that might throw that exception in its own try/catch block.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.