Source Code Cross Referenced for File.java in  » 6.0-JDK-Modules » j2me » com » sun » satsa » pkiapplet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.satsa.pkiapplet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *   
003:         *
004:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation.
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt).
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions.
025:         */
026:
027:        package com.sun.satsa.pkiapplet;
028:
029:        /**
030:         * This class represents card file.
031:         */
032:        class File {
033:
034:            /** File type constant - dedicated file (DF). */
035:            static final byte DIR = 1;
036:            /**
037:             *  File type constant - DF where PINs reside, must be unique for
038:             * this implementation. */
039:            static final byte PIN = 3;
040:            /**
041:             * File type constant - elementary file (EF) where private key
042:             * reside. */
043:            static final byte PrivateKeyFile = 4;
044:            /** File type constant - root DF for WIM application. */
045:            static final byte WIM = 9;
046:            /** File type constant - EF with read permission. */
047:            static final byte READ = 16;
048:            /** File type constant - EF with read/write permission. */
049:            static final byte UPDATE = 48;
050:            /** File attribute constant - EF is mostly empty . */
051:            static final byte EMPTY = 64;
052:
053:            /** Parent DF. */
054:            DFile parent;
055:            /** File identifier. */
056:            short id;
057:            /** File type. */
058:            short type;
059:
060:            /**
061:             * Returns true if this file is DF.
062:             * @return true.
063:             */
064:            boolean isDF() {
065:                return true;
066:            }
067:        }
068:
069:        /**
070:         * This class represents dedicated card file.
071:         */
072:        class DFile extends File {
073:
074:            /**
075:             * Files contained in this DF.
076:             */
077:            File[] files;
078:
079:            /**
080:             * Constructs new DFile oblect.
081:             * @param parent parent DF
082:             * @param id file identifier
083:             * @param type file type
084:             */
085:            public DFile(DFile parent, short id, short type) {
086:
087:                this .parent = parent;
088:                this .id = id;
089:                this .type = type;
090:            }
091:
092:            /**
093:             * This method is used in file selection.
094:             * @param id file identifier
095:             * @return this file if it has specified identifier, one of the
096:             * files in this DF or null if not found
097:             */
098:            public File getFile(short id) {
099:
100:                if (this .id == id) {
101:                    return this ;
102:                }
103:
104:                for (short i = 0; i < files.length; i++) {
105:
106:                    if (files[i].id == id) {
107:                        return files[i];
108:                    }
109:                }
110:                return null;
111:            }
112:        }
113:
114:        /**
115:         * This class represents elementary card file.
116:         */
117:        class EFile extends File {
118:
119:            /** Offset of file data in <code>Data.Files</code> array. */
120:            short offset;
121:            /** File length. */
122:            short length;
123:            /** File data. */
124:            byte[] data;
125:
126:            /**
127:             * Constructs new EFile object.
128:             * @param parent parent DF
129:             * @param id file identifier
130:             * @param type file type
131:             * @param offset offset of file data in <code>data</code> array
132:             * @param length file length
133:             * @param data array where file data stored
134:             */
135:            public EFile(DFile parent, short id, short type, short offset,
136:                    short length, byte[] data) {
137:
138:                this .parent = parent;
139:                this .id = id;
140:                this .type = type;
141:                this .offset = offset;
142:                this .length = length;
143:                this .data = data;
144:            }
145:
146:            /**
147:             * Returns true if this file is DF.
148:             * @return false
149:             */
150:            boolean isDF() {
151:                return false;
152:            }
153:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.