-
Notifications
You must be signed in to change notification settings - Fork 131
Improvements to FreeJ2ME's game compatibility by adding some missing classes (redone) #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
3ee6a3c
35cb096
255da6a
f34c901
ac0f2dc
0522ab4
2086bc4
f9f113f
dc1e467
424df51
d242d61
30ea5f0
c14d5c4
2f6ca2c
4e0cab9
08f6a91
c40e573
bcd09cc
25da782
805b073
5dda662
83fe551
929af84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| */ | ||
| package javax.microedition.io.file; | ||
|
|
||
| import java.io.IOException; | ||
| import java.io.DataInputStream; | ||
| import java.io.DataOutputStream; | ||
| import java.io.InputStream; | ||
|
|
@@ -26,65 +27,76 @@ | |
|
|
||
| public interface FileConnection extends StreamConnection | ||
| { | ||
| public long availableSize(); | ||
| long availableSize() throws SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public boolean canRead(); | ||
| boolean canRead() throws SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public boolean canWrite(); | ||
| boolean canWrite() throws SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public void create(); | ||
| void create() throws IOException, SecurityException, IllegalModeException; | ||
|
|
||
| public void delete(); | ||
| void delete() throws IOException, SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public long directorySize(boolean includeSubDirs); | ||
| long directorySize(boolean includeSubDirs) throws IOException, SecurityException, IllegalModeException, | ||
| ConnectionClosedException; | ||
|
|
||
| public boolean exists(); | ||
| boolean exists() throws SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public long fileSize(); | ||
| long fileSize() throws IOException, SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public String getName(); | ||
| String getName(); | ||
|
|
||
| public String getPath(); | ||
| String getPath(); | ||
|
|
||
| public String getURL(); | ||
| String getURL(); | ||
|
|
||
| public boolean isDirectory(); | ||
| boolean isDirectory() throws IOException, SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public boolean isHidden(); | ||
| boolean isHidden() throws SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public boolean isOpen(); | ||
| boolean isOpen(); | ||
|
|
||
| public long lastModified(); | ||
| long lastModified() throws SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public Enumeration list(); | ||
| Enumeration list() throws IOException, SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public Enumeration list(String filter, boolean includeHidden); | ||
| Enumeration list(String filter, boolean includeHidden) throws NullPointerException, IllegalArgumentException, | ||
| IOException, SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public void mkdir(); | ||
| void mkdir() throws IOException, SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public DataInputStream openDataInputStream(); | ||
| @Override /* Throws IOException in the docs, but not on the overriden class */ | ||
| DataInputStream openDataInputStream() throws SecurityException, IllegalModeException; | ||
|
|
||
| public DataOutputStream openDataOutputStream(); | ||
| @Override /* Throws IOException in the docs, but not on the overriden class */ | ||
| DataOutputStream openDataOutputStream() throws SecurityException, IllegalModeException; | ||
|
|
||
| public InputStream openInputStream(); | ||
| @Override /* Throws IOException in the docs, but not on the overriden class */ | ||
| InputStream openInputStream() throws SecurityException, IllegalModeException; | ||
|
|
||
| public OutputStream openOutputStream(); | ||
| @Override /* Throws IOException in the docs, but not on the overriden class */ | ||
| OutputStream openOutputStream() throws SecurityException, IllegalModeException; | ||
|
|
||
| public OutputStream openOutputStream(long byteOffset); | ||
| OutputStream openOutputStream(long byteOffset) throws IOException, SecurityException, IllegalModeException, | ||
| IllegalArgumentException; | ||
|
|
||
| public void rename(); | ||
| void rename(String newName) throws IOException, SecurityException, IllegalModeException, ConnectionClosedException, | ||
| NullPointerException, IllegalArgumentException; | ||
|
|
||
| public void setFileConnection(String fileName); | ||
| void setFileConnection(String fileName) throws IOException, SecurityException, NullPointerException, | ||
| IllegalArgumentException; | ||
|
|
||
| public void setHidden(boolean hidden); | ||
| void setHidden(boolean hidden) throws IOException, SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public void setReadable(boolean readable); | ||
| void setReadable(boolean readable) throws IOException, SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public void setWritable(boolean writable); | ||
| void setWritable(boolean writable) throws IOException, SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public long totalSize(); | ||
| long totalSize() throws SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public void truncate(long byteOffset); | ||
| void truncate(long byteOffset) throws IOException, SecurityException, IllegalModeException, ConnectionClosedException, | ||
| IllegalArgumentException; | ||
|
|
||
| long usedSize() throws SecurityException, IllegalModeException, ConnectionClosedException; | ||
|
|
||
| public long usedSize(); | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While it doesn't really matter in Java, there's no reason not to add a newline at the end. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,11 +18,15 @@ | |
|
|
||
| import java.util.Enumeration; | ||
|
|
||
| public abstract class FileSystemRegistry | ||
| public class FileSystemRegistry extends Object | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, that was just to make an exact transcription of the docs, i still need to clean some things up. |
||
| { | ||
| public abstract boolean addFileSystemListener(FileSystemListener listener); | ||
| Enumeration roots; /* A zero-length Enumeration to be used below */ | ||
|
|
||
| public abstract Enumeration listRoots(); | ||
| public static boolean addFileSystemListener(FileSystemListener listener) throws SecurityException, | ||
| NullPointerException { return false; } /* Returns if the fileSystemListener was added, similar for the remove below */ | ||
|
|
||
| public Enumeration listRoots() { return roots; }; /*If no roots are found, or it's not supported, return a zero-len enum*/ | ||
|
|
||
| public static boolean removeFileSystemListener(FileSystemListener listener) throws NullPointerException { return false; }; | ||
|
|
||
| public abstract boolean removeFileSystemListener(FileSystemListener listener); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,9 @@ | |
|
|
||
| public class IllegalModeException extends RuntimeException | ||
| { | ||
| public IllegalModeException() {} | ||
| public IllegalModeException() { } /* Constructs an instance of the class with its stack trace */ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure this comment or its twin are helpful.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those were just copied from the docs, but they're a bit vague, yes. Makes more sense to drop them altogether. |
||
|
|
||
| /* Constructs an instance of the class with its stack trace and message */ | ||
| public IllegalModeException(String detailMessage) { System.out.println("IllegalModeException: " + detailMessage); } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" Throws IOException in the docs, but not on the overriden class" What does this mean? What other class? Remember that this is an API. That means it is entirely separate from any specific application that uses it.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means that this DataOutputStream method is described as throwing an IOException in the javadocs. However, our current implementation (the compiler at least complained about not overriding a function with the same name as that) doesn't. I'll clean it up later when i do a second pass on all those files.