PrefsSpi.java revision 1568
3153N/A/*
3153N/A * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
3153N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3153N/A *
3153N/A * This code is free software; you can redistribute it and/or modify it
3153N/A * under the terms of the GNU General Public License version 2 only, as
3153N/A * published by the Free Software Foundation.
3153N/A *
3153N/A * This code is distributed in the hope that it will be useful, but WITHOUT
3153N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3153N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3153N/A * version 2 for more details (a copy is included in the LICENSE file that
3153N/A * accompanied this code).
3153N/A *
3153N/A * You should have received a copy of the GNU General Public License version
3153N/A * 2 along with this work; if not, write to the Free Software Foundation,
3153N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3153N/A *
3153N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
3153N/A * CA 95054 USA or visit www.sun.com if you need additional information or
3153N/A * have any questions.
3153N/A */
3516N/A
3516N/A
3516N/Aimport java.util.prefs.Preferences;
3516N/A
3153N/A/*
3516N/A * main class used by regtest PrefsSpi.sh
3516N/A */
3516N/Apublic class PrefsSpi {
3516N/A
3516N/A public static void main (String[] args) throws Exception {
3153N/A if (args.length != 1)
3153N/A throw new Exception("Usage: java PrefsSpi REGEXP");
3153N/A
3153N/A String className = Preferences.userRoot().getClass().getName();
3153N/A System.out.printf("className=%s%n", className);
3516N/A
3516N/A if (! className.matches(args[0]))
3153N/A throw new Exception("Preferences class name \"" + className
3153N/A + "\" does not match regular expression \""
3153N/A + args[0] + "\".");
3153N/A }
3153N/A}
3153N/A