Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3ee6a3c
javax: microedition: rms: Truncate record IDs to 0 in some cases.
AShiningRay Jun 8, 2022
35cb096
freej2me-lr: Fix rotated pointer coordinates.
AShiningRay Jun 9, 2022
255da6a
javax: io: Implement the javax.microedition.io.file.* classes.
AShiningRay Jun 11, 2022
f34c901
javax: bluetooth: Stub some missing classes and interfaces.
AShiningRay Jun 11, 2022
ac0f2dc
javax: io: Update the file/ folder.
AShiningRay Jun 12, 2022
0522ab4
freej2me: libretro: Make the pointer position calc more readable.
AShiningRay Jun 12, 2022
2086bc4
src: javax: Stub the obex folder.
AShiningRay Jun 12, 2022
f9f113f
javax: bluetooth: Finish the file additions.
AShiningRay Jun 12, 2022
dc1e467
javax: bluetooth: Some cleanups to the files.
AShiningRay Jun 12, 2022
424df51
javax: io: Cleanups to the file/ folder.
AShiningRay Jun 12, 2022
d242d61
src: javax: Minor cleanup on the obex folder.
AShiningRay Jun 12, 2022
30ea5f0
javax: io: More cleanups and adjustments to the file/ folder.
AShiningRay Jun 14, 2022
c14d5c4
javax: obex: More adjustments to the obex files.
AShiningRay Jun 14, 2022
2f6ca2c
javax: bluetooth: Clean up LocalDevice and implement UUID
AShiningRay Jun 14, 2022
4e0cab9
Revert "Truncate record IDs to 0 in some cases."
AShiningRay Jun 22, 2022
08f6a91
javax: bluetooth: UUID: Fix some uuid conversion problems.
AShiningRay Jun 28, 2022
c40e573
javax: bluetooth: UUID: Improve the code with a few ideas.
AShiningRay Jun 29, 2022
bcd09cc
javax: bluetooth: UUID: Fixing a small typo.
AShiningRay Jun 29, 2022
25da782
javax: bluetooth: UUID: Clearing an empty line at the start.
AShiningRay Jun 29, 2022
805b073
Revert "freej2me: libretro: Make the pointer position calc more reada…
AShiningRay Jun 29, 2022
5dda662
Revert "freej2me-lr: Fix rotated pointer coordinates."
AShiningRay Jun 29, 2022
83fe551
javax: bluetooth: UUID: Fixing one of the UUID constructors.
AShiningRay Jun 30, 2022
929af84
javax: bluetooth: UUID: Adjusting the UUID variables' types.
AShiningRay Jul 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

public class ConnectionClosedException extends RuntimeException
{
public ConnectionClosedException() {}
public ConnectionClosedException() { } /* Constructs an instance of the class with its stack trace */

/* Constructs an instance of the class with its stack trace and message */
public ConnectionClosedException(String detailMessage) { System.out.println("ConnectionClosedException: " + detailMessage); }

}
74 changes: 43 additions & 31 deletions src/javax/microedition/io/file/FileConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */

Copy link
Copy Markdown
Collaborator

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.

@AShiningRay AShiningRay Jun 12, 2022

Copy link
Copy Markdown
Contributor Author

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.

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();
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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.

7 changes: 4 additions & 3 deletions src/javax/microedition/io/file/FileSystemListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@

public interface FileSystemListener
{
public static final int ROOT_ADDED = 1;
static final int ROOT_ADDED = 0;

public static final int ROOT_REMOVED = 0;
static final int ROOT_REMOVED = 1;

public abstract void rootChanged(int state, String rootName);
void rootChanged(int state, String rootName) throws NullPointerException, IllegalArgumentException;

}
12 changes: 8 additions & 4 deletions src/javax/microedition/io/file/FileSystemRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@

import java.util.Enumeration;

public abstract class FileSystemRegistry
public class FileSystemRegistry extends Object

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extends Object is unnecessary as all Java classes extend Object.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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);
}
4 changes: 3 additions & 1 deletion src/javax/microedition/io/file/IllegalModeException.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

public class IllegalModeException extends RuntimeException
{
public IllegalModeException() {}
public IllegalModeException() { } /* Constructs an instance of the class with its stack trace */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this comment or its twin are helpful.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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); }

}